home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / s_to_z / vpe_130 / sqlwin / vpedemo.apt next >
Text File  |  1996-09-15  |  91KB  |  2,256 lines

  1. .head 0 +  Application Description: VPE Demo for SQLWindows 5.0 (VPEDEMO.APP)
  2.  
  3. Program code by Software Development Exceleration Unlimited
  4. Copyright ⌐ 1996 IDEAL Software - All rights reserved.
  5. .head 1 -  Outline Version - 4.0.26
  6. .head 1 +  Design-time Settings
  7. .head 2 -  Outline Window State: Normal
  8. .head 2 +  Outline Window Location and Size
  9. .data VIEWINFO
  10. 0000: 6600010002001B00 0000000000000000 0000E91E870E0500 1D00FFFF4D61696E
  11. 0020: 00
  12. .enddata
  13. .data VIEWSIZE
  14. 0000: 2100
  15. .enddata
  16. .head 3 -  Left:   -0.013"
  17. .head 3 -  Top:    0.0"
  18. .head 3 -  Width:  8.013"
  19. .head 3 -  Height: 4.969"
  20. .head 2 +  Options Box Location
  21. .data VIEWINFO
  22. 0000: D4180909B80B1A00
  23. .enddata
  24. .data VIEWSIZE
  25. 0000: 0800
  26. .enddata
  27. .head 3 -  Visible? No
  28. .head 3 -  Left:   4.15"
  29. .head 3 -  Top:    1.885"
  30. .head 3 -  Width:  3.8"
  31. .head 3 -  Height: 2.073"
  32. .head 2 +  Class Editor Location
  33. .head 3 -  Visible? No
  34. .head 3 -  Left:   0.575"
  35. .head 3 -  Top:    0.094"
  36. .head 3 -  Width:  5.063"
  37. .head 3 -  Height: 2.719"
  38. .head 2 +  Tool Palette Location
  39. .head 3 -  Visible? No
  40. .head 3 -  Left:   6.4"
  41. .head 3 -  Top:    0.729"
  42. .head 2 -  Fully Qualified External References? No
  43. .head 2 -  Reject Multiple Window Instances? Yes
  44. .head 2 -  Enable Runtime Checks Of External References? Yes
  45. .head 2 -  Use Release 4.0 Scope Rules? No
  46. .head 1 +  Libraries
  47. .head 2 -  ! Include VPENGINE.APL for the VPE interface
  48. .head 2 -  File Include: VPENGINE.APL
  49. .head 2 -  ! -----------------------------------------------------------------------------
  50. .head 2 -  ! CSTRUCT.APL (provided by Gupta with SQLWindows) 
  51. is needed for the CStructPutInt function used by VpePolyLine.
  52. This file is automatically included by VPENGINE.APL
  53. .head 2 -  File Include: CSTRUCT.APL
  54. .head 1 +  Global Declarations
  55. .head 2 +  Window Defaults
  56. .head 3 +  Tool Bar
  57. .head 4 -  Display Style? Etched
  58. .head 4 -  Font Name: System Default
  59. .head 4 -  Font Size: System Default
  60. .head 4 -  Font Enhancement: System Default
  61. .head 4 -  Text Color: System Default
  62. .head 4 -  Background Color: System Default
  63. .head 3 +  Form Window
  64. .head 4 -  Display Style? Etched
  65. .head 4 -  Font Name: System Default
  66. .head 4 -  Font Size: System Default
  67. .head 4 -  Font Enhancement: System Default
  68. .head 4 -  Text Color: System Default
  69. .head 4 -  Background Color: System Default
  70. .head 3 +  Dialog Box
  71. .head 4 -  Display Style? Etched
  72. .head 4 -  Font Name: System Default
  73. .head 4 -  Font Size: System Default
  74. .head 4 -  Font Enhancement: System Default
  75. .head 4 -  Text Color: System Default
  76. .head 4 -  Background Color: System Default
  77. .head 3 +  Top Level Table Window
  78. .head 4 -  Font Name: System Default
  79. .head 4 -  Font Size: System Default
  80. .head 4 -  Font Enhancement: System Default
  81. .head 4 -  Text Color: System Default
  82. .head 4 -  Background Color: System Default
  83. .head 3 +  Data Field
  84. .head 4 -  Font Name: Use Parent
  85. .head 4 -  Font Size: Use Parent
  86. .head 4 -  Font Enhancement: Use Parent
  87. .head 4 -  Text Color: Use Parent
  88. .head 4 -  Background Color: Use Parent
  89. .head 3 +  Multiline Field
  90. .head 4 -  Font Name: Use Parent
  91. .head 4 -  Font Size: Use Parent
  92. .head 4 -  Font Enhancement: Use Parent
  93. .head 4 -  Text Color: Use Parent
  94. .head 4 -  Background Color: Use Parent
  95. .head 3 +  Spin Field
  96. .head 4 -  Font Name: Use Parent
  97. .head 4 -  Font Size: Use Parent
  98. .head 4 -  Font Enhancement: Use Parent
  99. .head 4 -  Text Color: Use Parent
  100. .head 4 -  Background Color: Use Parent
  101. .head 3 +  Background Text
  102. .head 4 -  Font Name: Use Parent
  103. .head 4 -  Font Size: Use Parent
  104. .head 4 -  Font Enhancement: Use Parent
  105. .head 4 -  Text Color: Use Parent
  106. .head 4 -  Background Color: Use Parent
  107. .head 3 +  Pushbutton
  108. .head 4 -  Font Name: Use Parent
  109. .head 4 -  Font Size: Use Parent
  110. .head 4 -  Font Enhancement: Use Parent
  111. .head 3 +  Radio Button
  112. .head 4 -  Font Name: Use Parent
  113. .head 4 -  Font Size: Use Parent
  114. .head 4 -  Font Enhancement: Use Parent
  115. .head 4 -  Text Color: Use Parent
  116. .head 4 -  Background Color: Use Parent
  117. .head 3 +  Check Box
  118. .head 4 -  Font Name: Use Parent
  119. .head 4 -  Font Size: Use Parent
  120. .head 4 -  Font Enhancement: Use Parent
  121. .head 4 -  Text Color: Use Parent
  122. .head 4 -  Background Color: Use Parent
  123. .head 3 +  Option Button
  124. .head 4 -  Font Name: Use Parent
  125. .head 4 -  Font Size: Use Parent
  126. .head 4 -  Font Enhancement: Use Parent
  127. .head 3 +  Group Box
  128. .head 4 -  Font Name: Use Parent
  129. .head 4 -  Font Size: Use Parent
  130. .head 4 -  Font Enhancement: Use Parent
  131. .head 4 -  Text Color: Use Parent
  132. .head 4 -  Background Color: Use Parent
  133. .head 3 +  Child Table Window
  134. .head 4 -  Font Name: Use Parent
  135. .head 4 -  Font Size: Use Parent
  136. .head 4 -  Font Enhancement: Use Parent
  137. .head 4 -  Text Color: Use Parent
  138. .head 4 -  Background Color: Use Parent
  139. .head 3 +  List Box
  140. .head 4 -  Font Name: Use Parent
  141. .head 4 -  Font Size: Use Parent
  142. .head 4 -  Font Enhancement: Use Parent
  143. .head 4 -  Text Color: Use Parent
  144. .head 4 -  Background Color: Use Parent
  145. .head 3 +  Combo Box
  146. .head 4 -  Font Name: Use Parent
  147. .head 4 -  Font Size: Use Parent
  148. .head 4 -  Font Enhancement: Use Parent
  149. .head 4 -  Text Color: Use Parent
  150. .head 4 -  Background Color: Use Parent
  151. .head 3 +  Line
  152. .head 4 -  Line Color: Use Parent
  153. .head 3 +  Frame
  154. .head 4 -  Border Color: Use Parent
  155. .head 4 -  Background Color: Use Parent
  156. .head 3 +  Picture
  157. .head 4 -  Border Color: Use Parent
  158. .head 4 -  Background Color: Use Parent
  159. .head 2 +  Formats
  160. .head 3 -  Number: 0'%'
  161. .head 3 -  Number: #0
  162. .head 3 -  Number: ###000
  163. .head 3 -  Number: ###000;'($'###000')'
  164. .head 3 -  Date/Time: hh:mm:ss AMPM
  165. .head 3 -  Date/Time: M/d/yy
  166. .head 3 -  Date/Time: MM-dd-yy
  167. .head 3 -  Date/Time: dd-MMM-yyyy
  168. .head 3 -  Date/Time: MMM d, yyyy
  169. .head 3 -  Date/Time: MMM d, yyyy hh:mm AMPM
  170. .head 3 -  Date/Time: MMMM d, yyyy hh:mm AMPM
  171. .head 2 +  External Functions
  172. .head 3 +  Library name: USER.EXE
  173. .head 4 +  Function: MoveWindow
  174. .head 5 -  Description:
  175. .head 5 -  Export Ordinal: 0
  176. .head 5 +  Returns
  177. .head 6 -  Boolean: BOOL
  178. .head 5 +  Parameters
  179. .head 6 -  Window Handle: HWND
  180. .head 6 -  Number: INT
  181. .head 6 -  Number: INT
  182. .head 6 -  Number: INT
  183. .head 6 -  Number: INT
  184. .head 6 -  Boolean: BOOL
  185. .head 2 +  Constants
  186. .data CCDATA
  187. 0000: 3000000000000000 0000000000000000 00000000
  188. .enddata
  189. .data CCSIZE
  190. 0000: 1400
  191. .enddata
  192. .head 3 +  System
  193. .head 4 -  Number: WM_SIZE = 0x0005
  194. .head 4 -  Number: WM_KEYDOWN = 0x0100
  195. .head 4 -  Number: WM_COMMAND = 0x0111
  196. .head 3 +  User
  197. .head 4 -  String: DEMO_TEXT = "The moment of impact bursts through the silence and in a roar of sound, the " ||
  198. "final second is prolonged in a world of echoes as if the concrete and clay of " ||
  199. "Broadway itself was reliving its memories.
  200. " || "The last great march past. Newsman stands limp as a whimper as audience and " ||
  201. "event are locked as one. Bing Crosby coos 'You don't have to feel pain " ||
  202. "to sing the blues, you don't have to holla - you don't feel a thing in your " ||
  203. "dollar collar.' Martin Luther cries 'Everbody Sing!' and rings the grand old " ||
  204. "liberty bell. Leary, weary of his prison cell, walks on heaven, talks on hell.
  205. " || "Who needs Medicare and the 35c flat rate fare, when Fred Astaire and " ||
  206. "Ginger Rogers are dancing through the air? From Broadway Melody stereotypes " ||
  207. "the band returns to 'Stars and Stripes' bringing a tear to the moonshiner, " ||
  208. "who's been pouring out his spirit from the illegal still. The pawn broker " ||
  209. "clears the noisy till and clutches his lucky dollar bill.
  210. " || "Then the blackout.
  211.  
  212. " || "[Genesis, 'The Lamb lies down on Broadway']"
  213. .head 4 -  Number: HEADLINE = 1 ! ordinal for storing a setting
  214. .head 4 -  String: RPT_PATH = 'journal.rpt'
  215. .head 2 -  Resources
  216. .head 2 +  Variables
  217. .head 3 -  Window Handle: ghWndMain
  218. .head 3 -  Sql Handle: ghSql
  219. .head 3 -  Number: gnPrecision
  220. .head 3 -  Number: gnPBackGnd
  221. .head 3 -  Number: gnSpeed
  222. .head 3 -  Number: gnColors
  223. .head 3 -  Number: gnReport
  224. .head 3 -  Number: gnGraph
  225. .head 3 -  !
  226. .head 3 -  Number: gnSumAmount
  227. .head 3 -  Number: gnSumProratedAmt
  228. .head 3 -  Number: gnSumTaxAmt
  229. .head 3 -  Boolean: gbTableCreated
  230. .head 2 +  Internal Functions
  231. .head 3 +  Function: page1
  232. .head 4 -  Description: Page 1 of Precision demo
  233. .head 4 -  Returns
  234. .head 4 +  Parameters
  235. .head 5 -  Number: hDoc
  236. .head 4 -  Static Variables
  237. .head 4 +  Local variables
  238. .head 5 -  Number: nY
  239. .head 4 +  Actions
  240. .head 5 -  Set nY = VpeWriteBox( hDoc, 575, 200, 1625, -1, 
  241. "[Center PenSize 3]This demo shows the capabilities and precision of VPE.
  242. Print this page and compare not only the positions of the frames, but the positions of each letter that can be seen.
  243. (Switch the grid on.)
  244. This is true WYSIWYG!!!
  245. ('What you see is what you get')
  246. Note that the nearest result can be seen at a scaling of 1:1.
  247. With every other scaling you get 'best results' in comparison to execution speed." )
  248. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, nY + 75, 2000, -1, 
  249. "['Arial' FontSize 14 Left Bold Italic Underline PenSize 0]RIGHT ALIGNED, 0.25 cm blue frame, light-blue backgr., red bold text, Arial 9 pt" )
  250. .head 5 -  Call VpeStoreSet( hDoc, HEADLINE )
  251. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 9 )
  252. .head 5 -  Call VpeSetPen( hDoc, 25, _VPE_PS_SOLID, COLOR_Blue )
  253. .head 5 -  Call VpeSetTextColor( hDoc, COLOR_Red )
  254. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_RIGHT, 1, 0, 0 )
  255. .head 5 -  Call VpeSetTransparentMode( hDoc, 0 )
  256. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  257. .head 5 -  ! nY + 30 because frame = 0.25 cm --> frame drawn around center of coordinates
  258. .head 5 -  ! we also want a little gap between the headline and the frame
  259. .head 5 -  Set nY = VpeWriteBox( hDoc, 150, nY + 30, 1850, -1, DEMO_TEXT )
  260. .head 5 -  Call VpeSetTransparentMode( hDoc, 1 )
  261. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  262. .head 5 -  Set nY = VpeWrite( hDoc, 250, nY + 75, 2000, -1, "JUSTIFIED, no frame, Times New Roman 11pt" )
  263. .head 5 -  Call VpeSelectFont( hDoc, 'Times New Roman', 11 )
  264. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_JUSTIFIED, 0, 0 , 0 )
  265. .head 5 -  Set nY = VpeWriteBox( hDoc, 250, nY + 20, 1550, -1, DEMO_TEXT )
  266. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  267. .head 5 -  Set nY = VpeWriteBox( hDoc, 250, nY + 75, 2000, -1, "CENTERED, thin yellow frame, Times New Roman 11pt" )
  268. .head 5 -  Call VpeSelectFont( hDoc, 'Times New Roman', 11 )
  269. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 0, 0 )
  270. .head 5 -  Call VpeSetPen( hDoc, 5, _VPE_PS_SOLID, COLOR_Yellow )
  271. .head 5 -  Set nY = VpeWriteBox( hDoc, 150, nY + 20, 1850, -1, DEMO_TEXT )
  272. .head 3 +  Function: page2
  273. .head 4 -  Description:
  274. .head 4 -  Returns
  275. .head 4 +  Parameters
  276. .head 5 -  Number: hDoc
  277. .head 4 -  Static Variables
  278. .head 4 +  Local variables
  279. .head 5 -  Number: nY
  280. .head 5 -  Number: nXR
  281. .head 5 -  Number: nXStep
  282. .head 5 -  Number: nYR
  283. .head 5 -  Number: nX
  284. .head 5 -  String: s
  285. .head 5 -  Number: nIndex
  286. .head 5 -  Number: nSkip
  287. .head 5 -  Number: nFirst
  288. .head 5 -  Number: nXX
  289. .head 5 -  Number: nOldY
  290. .head 5 -  Number: nSegments
  291. .head 5 -  : p[*]
  292. .head 6 -  Class: POINT
  293. .head 5 -  : points[*]
  294. .head 6 -  Class: POINT
  295. .head 5 -  Number: hP
  296. .head 5 -  Boolean: bContinue
  297. .head 4 +  Actions
  298. .head 5 -  ! Call VpePageBreak( hDoc ) ! only needed if page2 is put back into Precision(  )
  299. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  300. .head 5 -  Set nY = VpeWriteBox( hDoc, 200, 200, 2000, -1, "An example of drawing (better to turn the grid off here):" )
  301. .head 5 -  Call VpeSetPen( hDoc, 8, _VPE_PS_SOLID, COLOR_Black )
  302. .head 5 -  Call VpeBox( hDoc, 200, 300, 1700, 1800 )
  303. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  304. .head 5 -  Set nXR = 6
  305. .head 5 -  Set nXStep = nXR / 750
  306. .head 5 -  Set nYR = 18
  307. .head 5 -  Set nX = -nXR
  308. .head 5 -  Set nSkip = 0
  309. .head 5 -  Call VpeSetPen( hDoc, 2, _VPE_PS_SOLID, COLOR_Blue )
  310. .head 5 -  Set hP = VpePolyLineInit( hDoc, 1500 )
  311. .head 5 -  Set nXX = 200
  312. .head 5 +  While nXX < 1700
  313. .head 6 -  Set nY = 1050 - ( ( SalNumberPower( nX, 3 ) - 2 * SalNumberPower( nX, 2 ) - 8 * nX ) / ( nYR / 750 ) )
  314. .head 6 -  Set nX = nX + nXStep
  315. .head 6 -  Set bContinue = FALSE
  316. .head 6 +  If nY < 300
  317. .head 7 -  Set nY = 300
  318. .head 7 -  Set nSkip = 1
  319. .head 7 -  Set bContinue = TRUE
  320. .head 6 +  Else If nY > 1800
  321. .head 7 -  Set nY = 1800
  322. .head 7 -  Set nSkip = 1
  323. .head 7 -  Set bContinue = TRUE
  324. .head 6 +  If NOT bContinue
  325. .head 7 +  If nSkip = 1
  326. .head 8 -  Call VpeAddPolyPoint( hDoc, hP, -1, -1 )
  327. .head 8 -  Set nOldY = nY
  328. .head 8 -  Set nSkip = 2
  329. .head 7 +  Else
  330. .head 8 +  If nSkip = 2
  331. .head 9 -  Call VpeAddPolyPoint( hDoc, hP, nXX - 1, nOldY )
  332. .head 9 -  Set nSkip = 0
  333. .head 8 -  Call VpeAddPolyPoint( hDoc, hP, nXX, nY )
  334. .head 8 -  Set nSegments = nSegments + 1
  335. .head 6 -  Set nXX = nXX + 1
  336. .head 5 -  ! The following graph is created directly with VpePolyLine(  )
  337. .head 5 -  Set nX = -nXR
  338. .head 5 -  Set nFirst = 1
  339. .head 5 -  Call VpeSetPen( hDoc, 2, _VPE_PS_SOLID, COLOR_Red )
  340. .head 5 -  Set nIndex = 0
  341. .head 5 -  Set nXX = 200
  342. .head 5 +  While nXX < 1700
  343. .head 6 -  Set nY = 1050 - ( 3 * SalNumberPower( nX, 2 ) - 4 * nX - 8 ) / ( nYR / 750 )
  344. .head 6 -  Set nX = nX + nXStep
  345. .head 6 -  Set bContinue = FALSE
  346. .head 6 +  If nY < 300
  347. .head 7 -  Set nY = 300
  348. .head 7 -  Set nSkip = 1
  349. .head 7 -  Set bContinue = TRUE
  350. .head 6 +  Else If nY > 1800
  351. .head 7 -  Set nY = 1800
  352. .head 7 -  Set nSkip = 1
  353. .head 7 -  Set bContinue = TRUE
  354. .head 6 +  If NOT bContinue
  355. .head 7 +  If nSkip = 1
  356. .head 8 +  If nIndex > 0 ! Array must not begin with -1,-1 pair
  357. .head 9 -  Set points[nIndex].nX = -1
  358. .head 9 -  Set points[nIndex].nY = -1
  359. .head 8 -  ! don't increment index here, so we don't have multiple
  360. .head 8 -  ! (redundant and FORBIDDEN) -1,-1 pairs in the array
  361. .head 8 -  Set nOldY = nY
  362. .head 8 -  Set nSkip = 2
  363. .head 7 +  Else
  364. .head 8 +  If nSkip = 2
  365. .head 9 +  If nIndex > 0
  366. .head 10 -  Set nIndex = nIndex + 1
  367. .head 9 -  Set points[nIndex].nX = nXX - 1
  368. .head 9 -  Set points[nIndex].nY = nOldY
  369. .head 9 -  Set nIndex = nIndex + 1
  370. .head 9 -  Set nSkip = 0
  371. .head 8 -  Set points[nIndex].nX = nXX
  372. .head 8 -  Set points[nIndex].nY = nY
  373. .head 8 -  Set nIndex = nIndex + 1
  374. .head 8 -  Set nSegments = nSegments + 1
  375. .head 6 -  Set nXX = nXX + 1
  376. .head 5 -  Call VpePolyLine( hDoc, points, nIndex )
  377. .head 5 -  ! The following graph is created 'manually' VpeLine(  )
  378. .head 5 -  ! Never use it for such tasks, it's slow and memory exhausting
  379. .head 5 -  ! in comparison to VpePolyLine
  380. .head 5 -  Set nX = -nXR
  381. .head 5 -  Set nFirst = 1
  382. .head 5 -  Call VpeSetPen( hDoc, 2, _VPE_PS_SOLID, COLOR_Green )
  383. .head 5 -  Set nXX = 200
  384. .head 5 +  While nXX < 1700
  385. .head 6 -  Set nY = 1050 - ( 3 * nX - 4 ) / ( nYR / 750 )
  386. .head 6 -  Set nX = nX + nXStep
  387. .head 6 -  Set bContinue = FALSE
  388. .head 6 +  If nY < 300
  389. .head 7 -  Set nY = 300
  390. .head 7 -  Set nFirst = 1
  391. .head 7 -  Set bContinue = TRUE
  392. .head 6 +  Else If nY > 1800
  393. .head 7 -  Set nY = 1800
  394. .head 7 -  Set nFirst = 1
  395. .head 7 -  Set bContinue = TRUE
  396. .head 6 +  If NOT bContinue
  397. .head 7 +  If nFirst
  398. .head 8 -  Set nOldY = nY
  399. .head 7 +  Else
  400. .head 8 -  Call VpeLine( hDoc, nXX - 1, nOldY, nXX, nY )
  401. .head 8 -  Set nSegments = nSegments + 1
  402. .head 8 -  Set nOldY = nY
  403. .head 7 -  Set nFirst = 0
  404. .head 6 -  Set nXX = nXX + 1
  405. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  406. .head 5 -  Call VpeLine( hDoc, 200, 1050, 1700, 1050 )
  407. .head 5 -  Call VpeLine( hDoc, 950, 300, 950, 1800 )
  408. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 10 )
  409. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  410. .head 5 -  Call VpeSetPen( hDoc, 1, _VPE_PS_DOT, COLOR_Black )
  411. .head 5 -  Set nXX = 1
  412. .head 5 +  While nXX < nXR
  413. .head 6 -  Call VpeLine( hDoc, 950 + nXX * 750 / 6, 300, 950 + nXX * 750 / 6, 1800 )
  414. .head 6 -  Set s = SalNumberToStrX( nXX, 0 )
  415. .head 6 -  Call VpePrint( hDoc, 950 + nXX * 750 / 6, 1050, s )
  416. .head 6 -  Call VpeLine( hDoc, 950 - nXX * 750 / 6, 300, 950 - nXX * 750 / 6, 1800 )
  417. .head 6 -  Set s = SalNumberToStrX( -nXX, 0 )
  418. .head 6 -  Call VpePrint( hDoc, 950 - nXX * 750 / 6, 1050, s )
  419. .head 6 -  Set nXX = nXX + 1
  420. .head 5 -  Set nY = 2
  421. .head 5 +  While nY < nYR
  422. .head 6 -  Call VpeLine( hDoc, 200, 1050 + nY * 750 / nYR, 1700, 1050 + nY * 750 / nYR )
  423. .head 6 -  Set s = SalNumberToStrX( nY, 0 )
  424. .head 6 -  Call VpePrint( hDoc, 950, 1050 - nY * 750 / nYR, s )
  425. .head 6 -  Call VpeLine( hDoc, 200, 1050 - nY * 750 / nYR, 1700, 1050 - nY * 750 / nYR )
  426. .head 6 -  Set s = SalNumberToStrX( -nY, 0 )
  427. .head 6 -  Call VpePrint( hDoc, 950, 1050 + nY * 750 / nYR, s )
  428. .head 6 -  Set nY = nY + 2
  429. .head 5 -  Set nY = 1850
  430. .head 5 -  Set s = "[S 14]The three graphs together consist of " || SalNumberToStrX( nSegments, 0 ) || " (number determined during runtime) single lines!
  431.  
  432. VPE manages this data bulk fast for you FAST!"
  433. .head 5 -  Call VpeWrite( hDoc, 200, nY, 2000, -1, s )
  434. .head 3 +  Function: page3_4
  435. .head 4 -  Description:
  436. .head 4 -  Returns
  437. .head 4 +  Parameters
  438. .head 5 -  Number: hDoc
  439. .head 4 -  Static Variables
  440. .head 4 -  Local variables
  441. .head 4 +  Actions
  442. .head 5 -  Call VpePageBreak( hDoc )
  443. .head 5 -  Call VpeNoPen( hDoc )
  444. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 1, 0 )
  445. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 18 )
  446. .head 5 -  Call VpeWrite( hDoc, 0, 150, 2100, 300, 'The supported barcode-types:' )
  447. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 10 )
  448. .head 5 -  Call VpeSetBold( hDoc, 1 )
  449. .head 5 -  Call VpeWrite( hDoc, 200, 300, 550, 400, "2 of 5:" )
  450. .head 5 -  Call VpeBarcode( hDoc, 200, 360, 550, 560, BCT_2OF5, "123789", "" )
  451. .head 5 -  Call VpeWrite( hDoc, 700, 300, 1200, 400, "Interleaved 2 of 5:" )
  452. .head 5 -  Call VpeBarcode( hDoc, 700, 360, 1200, 560, BCT_INTERLEAVED2OF5, "123895783482", '' )
  453. .head 5 -  Call VpeWrite( hDoc, 1350, 300, 1750, 400, "Code 39 (text on top)" )
  454. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 1, 0 )
  455. .head 5 -  Call VpeBarcode( hDoc, 1350, 360, 1750, 560, BCT_CODE39, "ABC123", "" )
  456. .head 5 -  Call VpeWrite( hDoc, 200, 700, 550, 800, "Code 93 (rotated):" )
  457. .head 5 -  Call VpeSetBarcodeParms( hDoc, 90, 0, 0 )
  458. .head 5 -  Call VpeBarcode( hDoc, 275, 760, 475, 1060, BCT_CODE93, "DEF987", "" )
  459. .head 5 -  Call VpeWrite( hDoc, 700, 700, 1200, 800, "Codabar (rotated):" )
  460. .head 5 -  Call VpeSetBarcodeParms( hDoc, 180, 0, 0 )
  461. .head 5 -  Call VpeBarcode( hDoc, 700, 760, 1200, 960, BCT_CODABAR, "123456", '' )
  462. .head 5 -  Call VpeWrite( hDoc, 1400, 700, 1700, 800, "EAN-8 (rotated):" )
  463. .head 5 -  Call VpeSetBarcodeParms( hDoc, 270, 0, 0 )
  464. .head 5 -  Call VpeBarcode( hDoc, 1450, 760, 1650, 1060, BCT_EAN8, '40167794', '' )
  465. .head 5 -  Call VpeWrite( hDoc, 200, 1200, 500, 1400, 'EAN-8 + 2:' )
  466. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0, 1 )
  467. .head 5 -  Call VpeBarcode( hDoc, 200, 1260, 500, 1460, BCT_EAN8_2, '12345670', '12' )
  468. .head 5 -  Call VpeWrite( hDoc, 700, 1200, 1200, 1400, "EAN-8 + 5:" )
  469. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0, 0 )
  470. .head 5 -  Call VpeBarcode( hDoc, 700, 1260, 1200, 1460, BCT_EAN8_5, '98765430', '12345' )
  471. .head 5 -  Call VpeWrite( hDoc, 1350, 1200, 1750, 1400, "EAN-13:" )
  472. .head 5 -  Call VpeBarcode( hDoc, 1350, 1260, 1750, 1460, BCT_EAN13, '9781556153952', '' )
  473. .head 5 -  Call VpeWrite( hDoc, 200, 1600, 600, 1800, "EAN-13 + 2:" )
  474. .head 5 -  Call VpeBarcode( hDoc, 200, 1660, 600, 1860, BCT_EAN13_2, '4501645096787', '12' )
  475. .head 5 -  Call VpeWrite( hDoc, 700, 1600, 1200, 1800, "EAN-13 + 5:" )
  476. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0, 1 )
  477. .head 5 -  Call VpeBarcode( hDoc, 700, 1660, 1200, 1860, BCT_EAN13_5, '9781556153952', '12345' )
  478. .head 5 -  Call VpeWrite( hDoc, 1350, 1600, 1750, 1800, "EAN-128 A:" )
  479. .head 5 -  Call VpeSetBarcodeParms( hDoc, 0, 0, 0 )
  480. .head 5 -  Call VpeBarcode( hDoc, 1350, 1660, 1750, 1860, BCT_EAN128A, "EAN-128 A", '' )
  481. .head 5 -  Call VpeWrite( hDoc, 200, 2000, 600, 2200, "EAN-128 B:" )
  482. .head 5 -  Call VpeBarcode( hDoc, 200, 2060, 600, 2260, BCT_EAN128B, "ean-128 b", '' )
  483. .head 5 -  Call VpeWrite( hDoc, 700, 2000, 1200, 2200, "EAN-128 C:" )
  484. .head 5 -  Call VpeBarcode( hDoc, 700, 2060, 1200, 2260, BCT_EAN128C, "128902", '' )
  485. .head 5 -  Call VpeWrite( hDoc, 1350, 2000, 1850, 2200, "POSTNET (1.20) 5 or 9 digits" )
  486. .head 5 -  Call VpeBarcode( hDoc, 1350, 2060, 1628, 2120, BCT_POSTNET, "12345", '' )
  487. .head 5 -  Call VpeBarcode( hDoc, 1350, 2150, 1850, 2210, BCT_POSTNET, "414649623", '' )
  488. .head 5 -  Call VpePageBreak( hDoc )
  489. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 1, 0 )
  490. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 18 )
  491. .head 5 -  Call VpeWrite( hDoc, 0, 150, 2100, 300, 'The supported barcode-types (continued):' )
  492. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 10 )
  493. .head 5 -  Call VpeSetBold( hDoc, 1 )
  494. .head 5 -  Call VpeWrite( hDoc, 200, 300, 550, 400, "UPC-A:" )
  495. .head 5 -  Call VpeBarcode( hDoc, 200, 360, 550, 560, BCT_UPCA, "07447079382", '' )
  496. .head 5 -  Call VpeWrite( hDoc, 700, 300, 1100, 400, "UPC-A + 2:" )
  497. .head 5 -  Call VpeBarcode( hDoc, 700, 360, 1100, 560, BCT_UPCA_2, '07447079382', '01' )
  498. .head 5 -  Call VpeWrite( hDoc, 1350, 300, 1800, 400, "UPC-A + 5:" )
  499. .head 5 -  Call VpeBarcode( hDoc, 1350, 360, 1800, 560, BCT_UPCA_5, '03126764825', '94687' )
  500. .head 5 -  Call VpeWrite( hDoc, 200, 700, 550, 900, 'UPC-E:' )
  501. .head 5 -  Call VpeBarcode( hDoc, 200, 760, 550, 960, BCT_UPCE, "0378492", '' )
  502. .head 5 -  Call VpeWrite( hDoc, 700, 700, 1100, 900, "UPC-E + 2:" )
  503. .head 5 -  Call VpeBarcode( hDoc, 700, 760, 1100, 960, BCT_UPCE_2, '0378492', '14' )
  504. .head 5 -  Call VpeWrite( hDoc, 1350, 700, 1800, 900, "UPC-E + 5:" )
  505. .head 5 -  Call VpeBarcode( hDoc, 1350, 760, 1800, 960, BCT_UPCE_5, "0364825", "79462" )
  506. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  507. .head 5 -  Call VpeWrite( hDoc, 200, 1100, 1800, 1800, 
  508. "VPE supports 21 barcode types. Barcodes can be rotated in 90 degree steps, the text can be drawn on bottom or top of the barcode, and also independently the add-on text. Any of these features can be combined." )
  509. .head 3 +  Function: page5
  510. .head 4 -  Description:
  511. .head 4 -  Returns
  512. .head 4 +  Parameters
  513. .head 5 -  Number: hDoc
  514. .head 4 -  Static Variables
  515. .head 4 +  Local variables
  516. .head 5 -  Number: nY
  517. .head 5 -  Number: nX
  518. .head 4 +  Actions
  519. .head 5 -  Call VpePageBreak( hDoc )
  520. .head 5 -  Call VpeUseSet( hDoc, HEADLINE )
  521. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, 200, 2000, -1, 
  522. "VPE is also able to manage bitmaps for you!
  523. Place your logo wherever you want." )
  524. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, nY, 1400, -1, 
  525. "[S 10 L BO IO UO] [Note: These are 256-color bitmaps, in 16-color mode it doesn't look very good)" )
  526. .head 5 -  Set nY = VpeWriteBox( hDoc, 100, nY + 50, 1400, -1, 
  527. "[N B U]VPE supports the following graphics file formats:" )
  528. .head 5 -  Call VpeWriteBox( hDoc, 100, nY, 1400, -1, 
  529. "-Windows and OS/2 Bitmaps (2 / 16 / 256 / True Color)
  530. -Windows WMF (Metafile)
  531. -AutoCAD DXF
  532. -GIF (2 / 16 / 256 Colors)
  533. -PCX (2 / 16 / 256 Colors)
  534. -JPG (256 / True Color)
  535. -TIFF 5.0 (2 / 16 / 256 / True Color, LZW / PackBits / Fax G3 / Fax G4 / Tiled Images)
  536. -Microsoft filters (feature, some restrictions and only 16-bit versions)" )
  537. .head 5 -  Call VpeSetPen( hDoc, 5, _VPE_PS_SOLID, COLOR_Black )
  538. .head 5 -  Call VpePicture( hDoc, 1400, 150, -1, -1, 'logo.bmp', VPE_PIC_KEEPIMAGE | VPE_PIC_KEEP_DIB_PAGE )
  539. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  540. .head 5 -  Set nX = VpeGet( hDoc, VRIGHT )
  541. .head 5 -  Call VpeWriteBox( hDoc, 1400, nY, nX, -1, "[N S 14 CE C White BC Red TO Italic Bold]IDEAL Software" )
  542. .head 5 -  Call VpeDefaultBitmapDPI( hDoc, 96, 96 )
  543. .head 5 -  Call VpePicture( hDoc, 1400, VpeGet( hDoc, VBOTTOM ) + 100, -1, -1, 'fruits.bmp', VPE_PIC_KEEPIMAGE | VPE_PIC_KEEP_DIB_PAGE )
  544. .head 5 -  Set nY = VpeWriteBox( hDoc, 150, nY + 400, 1500, -1, 
  545. "[S 14 CE PS 0]Scale your bitmaps as you like:" )
  546. .head 5 -  Set nY = nY + 20
  547. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  548. .head 5 -  Call VpePicture( hDoc, 150, nY, 200, -1, 'logo.bmp', 0 )
  549. .head 5 -  Call VpePicture( hDoc, VpeGet( hDoc, VRIGHT ) + 100, nY, VpeGet( hDoc, VRIGHT ) + 250, -1, 'logo.bmp', VPE_PIC_KEEPIMAGE | VPE_PIC_KEEP_DIB_PAGE )
  550. .head 5 -  Call VpePicture( hDoc, VpeGet( hDoc, VRIGHT ) + 100, nY, VpeGet( hDoc, VRIGHT ) + 750, -1, 'logo.bmp', VPE_PIC_KEEPIMAGE | VPE_PIC_KEEP_DIB_PAGE )
  551. .head 3 +  Function: page6
  552. .head 4 -  Description:
  553. .head 4 -  Returns
  554. .head 4 +  Parameters
  555. .head 5 -  Number: hDoc
  556. .head 4 -  Static Variables
  557. .head 4 -  Local variables
  558. .head 4 +  Actions
  559. .head 5 -  Call VpePageBreak( hDoc )
  560. .head 5 -  Call VpeNoPen( hDoc )
  561. .head 5 -  Call VpePicture( hDoc, 0, 0, -1, -1, 'gew.tif', VPE_PIC_KEEPIMAGE | VPE_PIC_KEEP_DIB_PAGE )
  562. .head 5 -  Call VpeWrite( hDoc, 250, 130, 1200, -1, "[S 24 C LtRed L PS 0]Stadt Xhausen" )
  563. .head 5 -  Call VpeWrite( hDoc, 250, 500, 1000, -1, "[S 14 C Blue]Mustermann & Co.
  564. Feinkost im- und Export" )
  565. .head 5 -  Call VpeWrite( hDoc, 1200, 460, 1700, -1, "[S 11 B]Dⁿsseldorf" )
  566. .head 5 -  Call VpeWrite( hDoc, 250, 680, 750, -1, "Schmidt" )
  567. .head 5 -  Call VpeWrite( hDoc, 250, 840, 750, -1, "24.7.1947" )
  568. .head 5 -  Call VpeWrite( hDoc, 500, 840, 1000, -1, "Oberammergau" )
  569. .head 5 -  Call VpeWrite( hDoc, 250, 1010, 750, -1, "Zunderstr. 93" )
  570. .head 5 -  Call VpeWrite( hDoc, 1000, 1010, 1750, -1, "0 27 84 / 16 45 98" )
  571. .head 5 -  Call VpeWrite( hDoc, 250, 1265, 1750, -1, "Willi-Graf-Str. 17" )
  572. .head 5 -  Call VpeWrite( hDoc, 1000, 1265, 1750, -1, "0 27 84 / 23 54 90" )
  573. .head 5 -  Call VpeWrite( hDoc, 1220, 670, 1750, -1, "Heinz - Willi" )
  574. .head 5 -  Call VpeWrite( hDoc, 1100, 1400, 1950, -1, 
  575. "[S 10 J I]It is very important to mention here, that there is no problem in using the special features of VPE, like justified text and all the other attributes. Here you can see justified italic text. " ||
  576. "These features and options make VPE a professional tool, that makes document processing easy for the developer, as well as for the end-user." )
  577. .head 3 +  Function: Precision
  578. .head 4 -  Description:
  579. .head 4 -  Returns
  580. .head 4 +  Parameters
  581. .head 5 -  Number: nMode
  582. .head 4 -  Static Variables
  583. .head 4 +  Local variables
  584. .head 5 -  Number: hDoc
  585. .head 4 +  Actions
  586. .head 5 +  If nMode = 0
  587. .head 6 -  Set hDoc = VpeOpenDoc( ghWndMain, "Precision + Capabilities", -1, -1, VPE_EMBEDDED | VPE_GRID_POSSIBLE | VPE_ROUTE_HELP )
  588. .head 6 -  Set gnPrecision = hDoc
  589. .head 5 +  Else
  590. .head 6 -  Set hDoc = VpeOpenDoc( ghWndMain, "Precision + Capabilities", -1, -1, 0 )
  591. .head 6 -  Set gnPBackGnd = hDoc
  592. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 1, 1 )
  593. .head 5 -  Call VpeSetPen( hDoc, 0, _VPE_PS_SOLID, 0 )
  594. .head 5 -  Call VpeDefineHeader( hDoc, 100, 100, 1000, 150, "Precision + Capabilities / IDEAL Software" )
  595. .head 5 -  Call VpeSetUnderlined( hDoc, 0 )
  596. .head 5 -  Call VpeDefineFooter( hDoc, 1900, 2800, 2100, 2900, "Page @PAGE" )
  597. .head 5 -  Call SalWaitCursor( TRUE )
  598. .head 5 -  Call page1( hDoc )
  599. .head 5 -  ! Call page2( hDoc )
  600. .head 5 -  Call page3_4( hDoc )
  601. .head 5 -  Call page5( hDoc )
  602. .head 5 -  Call page6( hDoc )
  603. .head 5 -  Call SalWaitCursor( FALSE )
  604. .head 5 -  Call VpeRemoveSet( hDoc, HEADLINE )
  605. .head 5 -  Call VpeGotoPage( hDoc, 1 )
  606. .head 5 +  If nMode = 0
  607. .head 6 -  Call VpePreviewDocTile( hDoc, VPE_SHOW_NORMAL )
  608. .head 5 +  Else
  609. .head 6 -  Call VpePrintDoc( hDoc, FALSE )
  610. .head 6 -  Call VpeCloseDoc( hDoc )
  611. .head 3 +  Function: reporttest
  612. .head 4 -  Description: Report Demo
  613. This is all done manually, only for your eyes...
  614. .head 4 -  Returns
  615. .head 4 -  Parameters
  616. .head 4 -  Static Variables
  617. .head 4 +  Local variables
  618. .head 5 -  Number: hDoc
  619. .head 5 -  Number: nY
  620. .head 4 +  Actions
  621. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, "Report", -1, -1, VPE_NO_USER_MOVE )
  622. .head 5 -  Set gnReport = hDoc
  623. .head 5 -  Call VpeSetPen( hDoc, 5, _VPE_PS_SOLID, COLOR_Black )
  624. .head 5 -  Call VpeDefaultBitmapDPI( hDoc, 96, 96 )
  625. .head 5 -  Call VpePicture( hDoc, 1650, 150, -1, -1, 'fruits.bmp', VPE_PIC_KEEPIMAGE | VPE_PIC_KEEP_DIB_PAGE )
  626. .head 5 -  Call VpeWriteBox( hDoc, 1650, VpeGet( hDoc, VBOTTOM ), VpeGet( hDoc, VRIGHT), -1, '[N S 9 CE I C Blue BC Gray TO]Fruits of Doom Software' )
  627. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 100
  628. .head 5 -  Call VpePrint( hDoc, 150, 200, '[N S 26 U]Year End Results' )
  629. .head 5 -  Call VpePrint( hDoc, 150, 400, '[N S 32]Fruits of Doom Software' )
  630. .head 5 -  Call VpeLine( hDoc, 150, nY, 2000, nY )
  631. .head 5 -  Set nY = nY + 50
  632. .head 5 -  Call VpeNoPen( hDoc )
  633. .head 5 -  Call VpePrintBox( hDoc, 150, nY, '[N S 18 C Blue]Product: Apples' )
  634. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 10
  635. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 16 C Purple]Country' )
  636. .head 5 -  Call VpePrint( hDoc, 650, nY, 'Quantity' )
  637. .head 5 -  Call VpePrint( hDoc, 1150, nY, 'Value (in $)' )
  638. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  639. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  640. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  641. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  642. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  643. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 14 C Black]Germany' )
  644. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '[R]2.450,00' )
  645. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "120.050,00" )
  646. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  647. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  648. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  649. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  650. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  651. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Great Britain' )
  652. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '2.250,00' )
  653. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "110.250,00" )
  654. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  655. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  656. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  657. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  658. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  659. .head 5 -  Call VpePrint( hDoc, 150, nY, 'France' )
  660. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.700,00' )
  661. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "83.300,00" )
  662. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  663. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  664. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  665. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  666. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  667. .head 5 -  Call VpePrint( hDoc, 150, nY, 'USA' )
  668. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '3.200,00' )
  669. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "156.800,00" )
  670. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  671. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  672. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  673. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  674. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  675. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Australia' )
  676. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.080,00' )
  677. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "52.920,00" )
  678. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  679. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Total' )
  680. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '10.680,00' )
  681. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "523.320,00" )
  682. .head 5 -  Set nY = nY + 210
  683. .head 5 -  Call VpePrintBox( hDoc, 150, nY, '[N S 18 C Blue]Product: Oranges' )
  684. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 10
  685. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 16 C Purple]Country' )
  686. .head 5 -  Call VpePrint( hDoc, 650, nY, 'Quantity' )
  687. .head 5 -  Call VpePrint( hDoc, 1150, nY, 'Value (in $)' )
  688. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  689. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  690. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  691. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  692. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  693. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 14 C Black]Germany' )
  694. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '[R]2.450,00' )
  695. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "120.050,00" )
  696. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  697. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  698. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  699. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  700. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  701. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Great Britain' )
  702. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '2.250,00' )
  703. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "110.250,00" )
  704. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  705. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  706. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  707. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  708. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  709. .head 5 -  Call VpePrint( hDoc, 150, nY, 'France' )
  710. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.700,00' )
  711. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "83.300,00" )
  712. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  713. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  714. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  715. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  716. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  717. .head 5 -  Call VpePrint( hDoc, 150, nY, 'USA' )
  718. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '3.200,00' )
  719. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "156.800,00" )
  720. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  721. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  722. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  723. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  724. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  725. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Australia' )
  726. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.080,00' )
  727. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "52.920,00" )
  728. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  729. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Total' )
  730. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '10.680,00' )
  731. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "523.320,00" )
  732. .head 5 -  Set nY = nY + 210
  733. .head 5 -  Call VpePrintBox( hDoc, 150, nY, '[N S 18 C Blue]Product: Bananas' )
  734. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 10
  735. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 16 C Purple]Country' )
  736. .head 5 -  Call VpePrint( hDoc, 650, nY, 'Quantity' )
  737. .head 5 -  Call VpePrint( hDoc, 1150, nY, 'Value (in $)' )
  738. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  739. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  740. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  741. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  742. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  743. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 14 C Black]Germany' )
  744. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '[R]2.450,00' )
  745. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "120.050,00" )
  746. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  747. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  748. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  749. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  750. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  751. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Great Britain' )
  752. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '2.250,00' )
  753. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "110.250,00" )
  754. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  755. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  756. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  757. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  758. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  759. .head 5 -  Call VpePrint( hDoc, 150, nY, 'France' )
  760. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.700,00' )
  761. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "83.300,00" )
  762. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  763. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  764. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Cyan )
  765. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  766. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  767. .head 5 -  Call VpePrint( hDoc, 150, nY, 'USA' )
  768. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '3.200,00' )
  769. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "156.800,00" )
  770. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  771. .head 5 -  Call VpeSetTransparentMode( hDoc, FALSE )
  772. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_Gray )
  773. .head 5 -  Call VpeBox( hDoc, 150, nY, 1550, nY + 60 )
  774. .head 5 -  Call VpeSetTransparentMode( hDoc, TRUE )
  775. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Australia' )
  776. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '1.080,00' )
  777. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "52.920,00" )
  778. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM )
  779. .head 5 -  Call VpePrint( hDoc, 150, nY, 'Total' )
  780. .head 5 -  Call VpeWrite( hDoc, 650, nY, 900, nY + 60, '10.680,00' )
  781. .head 5 -  Call VpeWrite( hDoc, 1150, nY, 1450, nY + 60, "523.320,00" )
  782. .head 5 -  Set nY = VpeGet( hDoc, VBOTTOM ) + 210
  783. .head 5 -  Call VpePrint( hDoc, 150, nY, '[S 20 U]Yearly Country Sales Total: $1.569.960,00' )
  784. .head 5 -  Call VpePreviewDoc( hDoc, 0, 0, 640, 400, VPE_SHOW_NORMAL )
  785. .head 3 +  Function: colortest
  786. .head 4 -  Description:
  787. .head 4 -  Returns
  788. .head 4 -  Parameters
  789. .head 4 -  Static Variables
  790. .head 4 +  Local variables
  791. .head 5 -  Number: nRange
  792. .head 5 -  Number: nStep
  793. .head 5 -  Number: nColorStep
  794. .head 5 -  Number: nMinColor
  795. .head 5 -  Number: nMaxColor
  796. .head 5 -  Number: hDoc
  797. .head 5 -  Number: nX
  798. .head 5 -  Number: nY
  799. .head 5 -  Number: nR
  800. .head 5 -  Number: nG
  801. .head 5 -  Number: nB
  802. .head 5 -  Number: nDeltaR
  803. .head 5 -  Number: nDeltaG
  804. .head 5 -  Number: nDeltaB
  805. .head 5 -  Number: nXX
  806. .head 5 -  Number: nFactor
  807. .head 4 +  Actions
  808. .head 5 -  Set nRange = 1400
  809. .head 5 -  Set nStep = 1
  810. .head 5 -  Set nColorStep = 2
  811. .head 5 -  Set nMinColor = 0
  812. .head 5 -  Set nMaxColor = 255
  813. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, 'Colors', -1, -1,
  814. VPE_NO_MOUSE_SCALE | VPE_NO_USER_MOVE | VPE_NO_USER_CLOSE | 
  815. VPE_NO_STATBAR | VPE_NO_RULER | VPE_NO_HELPBTN | VPE_NO_INFOBTN )
  816. .head 5 -  Call VpeSetScale( hDoc, 0.25 )
  817. .head 5 -  Set gnColors = hDoc
  818. .head 5 -  Call VpeSetPen( hDoc, 0, _VPE_PS_SOLID, COLOR_Black )
  819. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 30 )
  820. .head 5 -  Set nXX = -3.1415
  821. .head 5 -  Set nFactor = 2 * SalNumberAbs( nXX ) / nRange * nStep
  822. .head 5 -  Set nR = 192
  823. .head 5 -  Set nDeltaR = nColorStep
  824. .head 5 -  Set nG = nMinColor + 1
  825. .head 5 -  Set nDeltaG = nColorStep
  826. .head 5 -  Set nB = nMinColor + 1
  827. .head 5 -  Set nDeltaB = nColorStep
  828. .head 5 -  Set nX = 100
  829. .head 5 +  While nX < nRange + 100
  830. .head 6 -  Set nY = SalNumberSin( nXX ) * 500.0 + 500
  831. .head 6 -  Call VpeSetTextColor( hDoc, SalColorFromRGB( nR, nG, nB ) )
  832. .head 6 -  ! Call VpePrint( hDoc, nX, nY, 'Color Test' )
  833. .head 6 -  Call VpeWriteBox( hDoc, nX, nY, nX + 800, nY + 100, 'Color Test' )
  834. .head 6 +  If SalNumberMod( nX, 10 ) = 0
  835. .head 7 -  Set nXX = nXX + nFactor
  836. .head 7 -  Set nX = nX + nStep
  837. .head 7 -  Set nY = SalNumberSin( nXX ) * 500.0 + 500
  838. .head 7 -  Call VpeSetTextColor( hDoc, COLOR_Black )
  839. .head 7 -  Call VpeWriteBox( hDoc, nX, nY, nX + 800, nY + 100, 'Color Test' )
  840. .head 6 -  Set nXX = nXX + nFactor
  841. .head 6 +  If nR > nMinColor AND nR < nMaxColor
  842. .head 7 -  Set nR = nR + nDeltaR
  843. .head 7 +  If nR < nMinColor
  844. .head 8 -  Set nR = nMinColor
  845. .head 7 +  If nR > nMaxColor
  846. .head 8 -  Set nR = nMaxColor
  847. .head 6 +  Else If nG > nMinColor AND nG < nMaxColor 
  848. .head 7 -  Set nG = nG + nDeltaG
  849. .head 7 +  If nG < nMinColor
  850. .head 8 -  Set nG = nMinColor
  851. .head 7 +  If nG > nMaxColor
  852. .head 8 -  Set nG = nMaxColor
  853. .head 6 +  Else If nB > nMinColor AND nB < nMaxColor 
  854. .head 7 -  Set nB = nB + nDeltaB
  855. .head 7 +  If nB < nMinColor
  856. .head 8 -  Set nB = nMinColor
  857. .head 7 +  If nB > nMaxColor
  858. .head 8 -  Set nB = nMaxColor
  859. .head 6 +  If nR >= nMaxColor AND nB >= nMaxColor
  860. .head 7 -  Set nDeltaR = -nColorStep
  861. .head 7 -  Set nR = nMaxColor - 1
  862. .head 6 +  If nR >= nMinColor AND nG >= nMaxColor
  863. .head 7 -  Set nDeltaG = -nColorStep
  864. .head 7 -  Set nG = nMaxColor - 1
  865. .head 6 +  If nG = nMinColor AND nB >= nMaxColor
  866. .head 7 -  Set nDeltaB = -nColorStep
  867. .head 7 -  Set nB = nMaxColor - 1
  868. .head 6 +  If nR = nMinColor AND nG = nMinColor AND nB = nMinColor
  869. .head 7 -  Set nR = nMinColor + 1
  870. .head 7 -  Set nG = nMinColor + 1
  871. .head 7 -  Set nB = nMinColor + 1
  872. .head 7 -  Set nDeltaR = nColorStep
  873. .head 7 -  Set nDeltaG = nColorStep
  874. .head 7 -  Set nDeltaB = nColorStep
  875. .head 6 -  Call VpePreviewDoc( hDoc, 0, 0, 280, 200, VPE_SHOW_NORMAL )
  876. .head 6 -  Set nX = nX + nStep
  877. .head 3 +  ! Function: GenerateReport
  878. .head 4 -  Description: 
  879. .head 4 -  Returns 
  880. .head 4 -  Parameters 
  881. .head 4 -  Static Variables 
  882. .head 4 +  Local variables 
  883. .head 5 -  File Handle: hFileRpt
  884. .head 5 -  Number: nI
  885. .head 5 -  Number: nStepper
  886. .head 5 -  Number: nMin
  887. .head 5 -  Number: nZ
  888. .head 5 -  Number: nCount
  889. .head 5 -  Number: nTable
  890. .head 4 +  Actions 
  891. .head 5 -  Set nCount = 0
  892. .head 5 -  Set nTable = 1
  893. .head 5 -  ! Call SalNumberRandInit(  )
  894. .head 5 -  Call dlgVpeDemo.Status( 'Generating pseudo report-file...' )
  895. .head 5 -  Call SalFileOpen( hFileRpt, RPT_PATH, OF_Create | OF_Write | OF_Text)
  896. .head 5 -  Call SalFilePutStr( hFileRpt, "Test-Document" )
  897. .head 5 -  Call SalFilePutStr( hFileRpt, "1996
  898. " )
  899. .head 5 -  Set nZ = 0
  900. .head 5 +  While nCount < 20000
  901. .head 6 +  If nZ < SalNumberMod( SalNumberRandom(  ), 5 ) + 10
  902. .head 7 -  Set nStepper = 4
  903. .head 7 -  Set nMin = 3
  904. .head 7 -  Set nZ = nZ + 1
  905. .head 6 +  Else 
  906. .head 7 -  Set nStepper = 21
  907. .head 7 -  Set nMin = 20
  908. .head 7 -  Set nZ = 0
  909. .head 6 -  Call SalFilePutStr( hFileRpt, '@Table ' || SalNumberToStrX( nTable, 0 ) )
  910. .head 6 -  Set nTable = nTable + 1
  911. .head 6 -  Set nI = SalNumberMod( SalNumberRandom(  ), nStepper) + nMin
  912. .head 6 +  While nI > 0
  913. .head 7 -  Set nI = nI - 1
  914. .head 7 -  Call SalFilePutStr( hFileRpt, SalFmtFormatNumber( nCount, '###0' ) || '
  915. ' || SalFmtFormatNumber( SalNumberMod( SalNumberRandom(  ), 28 ) + 1, '#0' ) || '.' || 
  916. SalFmtFormatNumber( SalNumberMod( SalNumberRandom(  ), 12 ) + 1, '00' ) || '.95
  917. ' || SalFmtFormatNumber( SalNumberRandom(  ) + 
  918. ( SalNumberMod( SalNumberRandom(  ), 100 ) / 100 ), '####0.00' ) || '
  919. ' || SalFmtFormatNumber( SalNumberRandom(  ) + 
  920. ( SalNumberMod( SalNumberRandom(  ), 100 ) / 100 ), '####0.00' ) || '
  921. ' || SalFmtFormatNumber( SalNumberRandom(  ) + 
  922. ( SalNumberMod( SalNumberRandom(  ), 100 ) / 100 ), '####0.00' ) || '
  923.  
  924.  
  925. ' )
  926. .head 7 -  Set nCount = nCount + 7 
  927. .head 5 -  Call SalFileClose( hFileRpt )
  928. .head 5 -  Call dlgVpeDemo.Status( 'Report generation finished.' )
  929. .head 3 +  Function: GenerateData
  930. .head 4 -  Description:
  931. .head 4 +  Returns
  932. .head 5 -  Boolean:
  933. .head 4 -  Parameters
  934. .head 4 -  Static Variables
  935. .head 4 +  Local variables
  936. .head 5 -  Boolean: bRetVal
  937. .head 5 -  Number: nI
  938. .head 5 -  Number: nStepper
  939. .head 5 -  Number: nMin
  940. .head 5 -  Number: nZ
  941. .head 5 -  Number: nCount
  942. .head 5 -  Number: nTable
  943. .head 5 -  String: sTableName
  944. .head 5 -  String: sComment
  945. .head 5 -  Date/Time: dtTableDate
  946. .head 5 -  Number: nAmount
  947. .head 5 -  Number: nProratedAmt
  948. .head 5 -  Number: nTaxAmt
  949. .head 4 +  Actions
  950. .head 5 -  Call SalWaitCursor( TRUE )
  951. .head 5 -  Call SalNumberRandInit( SalDateSecond( SalDateCurrent(  ) ) * SalDateMinute( SalDateCurrent(  ) ) * SalDateHour( SalDateCurrent(  ) ) )
  952. .head 5 -  Set nTable = 1
  953. .head 5 -  Set nZ = 0
  954. .head 5 -  Set nCount = 0
  955. .head 5 -  Set sComment = ''
  956. .head 5 +  If SqlPrepare( ghSql, 'INSERT INTO #VPE_DEMO (TABLE_NAME, TABLE_COUNT, TABLE_DATE, AMOUNT, PRORATED_AMT, TAX_AMT, USER_COMMENT )
  957. VALUES ( :sTableName, :nCount, :dtTableDate, :nAmount, :nProratedAmt, :nTaxAmt, :sComment )' )
  958. .head 6 +  While nCount < 20000
  959. .head 7 +  If nZ < SalNumberMod( SalNumberRandom(  ), 5 ) + 10
  960. .head 8 -  Set nStepper = 4
  961. .head 8 -  Set nMin = 3
  962. .head 7 +  Else
  963. .head 8 -  Set nStepper = 21
  964. .head 8 -  Set nMin = 20
  965. .head 8 -  Set nZ = 0
  966. .head 7 -  Set nZ = nZ + 1
  967. .head 7 -  Set sTableName = 'Table ' || SalFmtFormatNumber( nTable, '000' )
  968. .head 7 -  Set nTable = nTable + 1
  969. .head 7 -  Set nI = SalNumberMod( SalNumberRandom(  ), nStepper ) + nMin
  970. .head 7 +  While nI > 0
  971. .head 8 -  Set dtTableDate = SalDateConstruct( 1995, SalNumberMod( SalNumberRandom(  ), 12 ) + 1, SalNumberMod( SalNumberRandom(  ), 28 ) + 1, 0, 0, 0 )
  972. .head 8 -  Set nAmount = SalNumberRandom(  ) + SalNumberRandom(  ) / 32768
  973. .head 8 -  Set nProratedAmt = SalNumberRandom(  ) + SalNumberRandom(  ) / 32768
  974. .head 8 -  Set nTaxAmt = SalNumberRandom(  ) + SalNumberRandom(  ) / 32768
  975. .head 8 -  Call SqlExecute( ghSql )
  976. .head 8 -  Set nCount = nCount + 7
  977. .head 8 -  Set nI = nI - 1
  978. .head 6 -  Call SqlCommit( ghSql )
  979. .head 6 -  Set bRetVal = TRUE
  980. .head 5 +  Else
  981. .head 6 -  Set bRetVal = FALSE
  982. .head 5 -  Call SalWaitCursor( FALSE )
  983. .head 5 -  Return bRetVal
  984. .head 3 +  ! PrintJournal routines
  985. .head 4 -  Structure of input file
  986. .head 4 -  ========================
  987. .head 4 -  User-name
  988. .head 4 -  Year
  989. .head 4 -  Start Month (or blank)
  990. .head 4 -  End Month (or blank)
  991. .head 4 -  <@>Table-Name --> start a new table!!!
  992. .head 4 -  No.
  993. .head 4 -  Date
  994. .head 4 -  Amount
  995. .head 4 -  Prorated Amount
  996. .head 4 -  Tax
  997. .head 4 -  Remark
  998. .head 4 -  Remark
  999. .head 3 -  ! NOTE: In this demo Y2 has a constant value for much faster processing
  1000. .head 3 +  Function: PrintHeader
  1001. .head 4 -  Description:
  1002. .head 4 -  Returns
  1003. .head 4 +  Parameters
  1004. .head 5 -  Number: hDoc
  1005. .head 5 -  String: sTable
  1006. .head 4 -  Static Variables
  1007. .head 4 -  Local variables
  1008. .head 4 +  Actions
  1009. .head 5 -  Call VpeSetAlign( hDoc, ALIGN_CENTER )
  1010. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 14 )
  1011. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_LightGray )
  1012. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, VRIGHTMARGIN, -60, sTable )
  1013. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 1, 0, 0 )
  1014. .head 5 -  Call VpeSelectFont( hDoc, 'Arial', 11 )
  1015. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, -200, -50, "No." )
  1016. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -200, VBOTTOM, "Date" )
  1017. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, "Amount" )
  1018. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, "Prorated Amount" )
  1019. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, "Tax" )
  1020. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, VRIGHTMARGIN, VBOTTOM, "Remark" )
  1021. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  1022. .head 5 -  Call VpeSetBkgColor( hDoc, SalColorFromRGB( 255, 255, 255 ) )
  1023. .head 3 +  Function: PrintFooter
  1024. .head 4 -  Description:
  1025. .head 4 -  Returns
  1026. .head 4 +  Parameters
  1027. .head 5 -  Number: hDoc
  1028. .head 4 -  Static Variables
  1029. .head 4 +  Local variables
  1030. .head 5 -  String: s
  1031. .head 4 +  Actions
  1032. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 1, 0, 0 )
  1033. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_LightGray )
  1034. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, -400, -50, "Sum" )
  1035. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_RIGHT, 1, 0, 0 )
  1036. .head 5 -  Set s = SalFmtFormatNumber( gnSumAmount, '###,##0.00' )
  1037. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, s )
  1038. .head 5 -  Set s = SalFmtFormatNumber( gnSumProratedAmt, '###,##0.00' )
  1039. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, s )
  1040. .head 5 -  Set s = SalFmtFormatNumber( gnSumTaxAmt, '###,##0.00' )
  1041. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, s )
  1042. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, VRIGHTMARGIN, VBOTTOM, '' )
  1043. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  1044. .head 5 -  Call VpeSetBkgColor( hDoc, COLOR_White )
  1045. .head 3 +  Function: PrintPageFooter
  1046. .head 4 -  Description:
  1047. .head 4 -  Returns
  1048. .head 4 +  Parameters
  1049. .head 5 -  Number: hDoc
  1050. .head 5 -  String: sName
  1051. .head 5 -  Number: nPage
  1052. .head 4 -  Static Variables
  1053. .head 4 -  Local variables
  1054. .head 4 +  Actions
  1055. .head 5 -  Call VpeStorePos( hDoc )
  1056. .head 5 -  Call VpeNoPen( hDoc )
  1057. .head 5 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOMMARGIN, VpeGet( hDoc, VRIGHTMARGIN ) - 400, -50, sName )
  1058. .head 5 -  Call VpeSetAlign( hDoc, ALIGN_RIGHT )
  1059. .head 5 -  Call VpeWriteBox( hDoc, VRIGHT, VBOTTOMMARGIN, VRIGHTMARGIN, -50, 'Journal Page ' || SalNumberToStrX( nPage, 0 ) )
  1060. .head 5 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  1061. .head 5 -  Call VpeRestorePos( hDoc )
  1062. .head 3 +  Function: PageBreak
  1063. .head 4 -  Description:
  1064. .head 4 -  Returns
  1065. .head 4 +  Parameters
  1066. .head 5 -  Number: hDoc
  1067. .head 5 -  Number: nPage
  1068. .head 4 -  Static Variables
  1069. .head 4 -  Local variables
  1070. .head 4 +  Actions
  1071. .head 5 -  Call VpePageBreak( hDoc )
  1072. .head 5 +  If SalNumberMod( nPage, 5 ) = 0
  1073. .head 6 -  Call dlgVpeDemo.Status( 'now reading demo data and generating page ' || SalNumberToStrX( nPage, 0 ) )
  1074. .head 3 +  Function: PrintJournal
  1075. .head 4 -  Description:
  1076. .head 4 +  Returns
  1077. .head 5 -  Boolean:
  1078. .head 4 -  Parameters
  1079. .head 4 -  Static Variables
  1080. .head 4 +  Local variables
  1081. .head 5 -  Number: hDoc
  1082. .head 5 -  String: s
  1083. .head 5 -  String: sBuf
  1084. .head 5 -  String: sName
  1085. .head 5 -  String: sYear
  1086. .head 5 -  String: sPeriod
  1087. .head 5 -  String: sTableName
  1088. .head 5 -  Number: nTableCount
  1089. .head 5 -  Date/Time: dtTableDate
  1090. .head 5 -  Number: nAmount
  1091. .head 5 -  Number: nProratedAmt
  1092. .head 5 -  Number: nTaxAmt
  1093. .head 5 -  String: sComment
  1094. .head 5 -  Boolean: bFooterOk
  1095. .head 5 -  Number: nPage
  1096. .head 5 -  Boolean: bRetVal
  1097. .head 5 -  Number: nFetchResult
  1098. .head 5 -  String: sOldTableName
  1099. .head 5 -  String: sTableDate
  1100. .head 4 +  Actions
  1101. .head 5 -  Set bRetVal = FALSE
  1102. .head 5 -  Set bFooterOk = FALSE
  1103. .head 5 -  Set nPage = 1
  1104. .head 5 -  Set sOldTableName = ''
  1105. .head 5 -  Call SalWaitCursor( TRUE )
  1106. .head 5 +  When SqlError
  1107. .head 6 -  Return FALSE
  1108. .head 5 +  If SqlPrepareAndExecute( ghSql, 
  1109. 'SELECT TABLE_NAME, TABLE_COUNT, TABLE_DATE, AMOUNT, PRORATED_AMT, TAX_AMT, USER_COMMENT 
  1110. FROM #VPE_DEMO ORDER BY TABLE_NAME, TABLE_COUNT 
  1111. INTO :sTableName, :nTableCount, :dtTableDate, :nAmount, :nProratedAmt, :nTaxAmt, :sComment' )
  1112. .head 6 -  Set hDoc = VpeOpenDoc( ghWndMain, "Speed + Tables", -1, -1, VPE_GRID_POSSIBLE )
  1113. .head 6 -  Set gnSpeed = hDoc
  1114. .head 6 -  Call VpeSetTransparentMode( hDoc, FALSE )
  1115. .head 6 -  Set sName = 'VPE Test Data'
  1116. .head 6 -  Set sYear = '1995'
  1117. .head 6 -  Set s = 'Journal ' || sYear
  1118. .head 6 -  Call VpeSetPen( hDoc, 0, 0, COLOR_Black )
  1119. .head 6 -  Call VpeSetFontAttr( hDoc, ALIGN_CENTER, 0, 1, 0 )
  1120. .head 6 -  Call VpeSelectFont( hDoc, 'Arial', 16 )
  1121. .head 6 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VTOPMARGIN, VRIGHTMARGIN, VFREE, s )
  1122. .head 6 -  Call VpeSetPen( hDoc, 3, _VPE_PS_SOLID, COLOR_Black )
  1123. .head 6 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 0, 0 )
  1124. .head 6 -  Call VpeSelectFont( hDoc, 'Arial', 11 )
  1125. .head 6 +  While SqlFetchNext( ghSql, nFetchResult )
  1126. .head 7 +  If sTableName != sOldTableName
  1127. .head 8 -  ! beginning of a new table
  1128. .head 8 +  If bFooterOk
  1129. .head 9 -  Call PrintFooter( hDoc )
  1130. .head 8 -  Set gnSumAmount = 0
  1131. .head 8 -  Set gnSumProratedAmt = 0
  1132. .head 8 -  Set gnSumTaxAmt = 0
  1133. .head 8 -  ! is the space to the bottom of the page sufficient for another table?
  1134. .head 8 +  If ( VpeGet( hDoc, VBOTTOMMARGIN) - VpeGet( hDoc, VBOTTOM ) ) < 400
  1135. .head 9 -  ! no, so add a new page
  1136. .head 9 -  Call PrintPageFooter( hDoc, sName, nPage )
  1137. .head 9 -  Call PageBreak( hDoc, nPage )
  1138. .head 9 -  Set nPage = nPage + 1
  1139. .head 8 +  Else
  1140. .head 9 -  ! begining on new table is 1 cm below previous table
  1141. .head 9 -  Call VpeSet( hDoc, VBOTTOM, VpeGet( hDoc, VBOTTOM ) + 100 )
  1142. .head 8 -  Call PrintHeader( hDoc, sTableName )
  1143. .head 8 -  Set bFooterOk = FALSE
  1144. .head 8 -  Set sOldTableName = sTableName
  1145. .head 7 +  Else
  1146. .head 8 -  ! list part
  1147. .head 8 -  Set bFooterOk = TRUE
  1148. .head 8 -  Call VpeSetTransparentMode( hDoc, 1 )
  1149. .head 8 -  Call VpeSetAlign( hDoc, ALIGN_RIGHT )
  1150. .head 8 -  Call VpeWriteBox( hDoc, VLEFTMARGIN, VBOTTOM, -200, -50, SalNumberToStrX( nTableCount, 0 ) )
  1151. .head 8 -  Call SalDateToStr( dtTableDate, sTableDate )
  1152. .head 8 -  Set sTableDate = SalStrMidX( sTableDate, 2, 8 )
  1153. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -200, VBOTTOM, sTableDate )
  1154. .head 8 -  Set gnSumAmount = gnSumAmount + nAmount
  1155. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, SalNumberToStrX( nAmount, 2 ) )
  1156. .head 8 -  Set gnSumProratedAmt = gnSumProratedAmt + nProratedAmt
  1157. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, SalNumberToStrX( nProratedAmt, 2 ) )
  1158. .head 8 -  Set gnSumTaxAmt = gnSumTaxAmt + nTaxAmt
  1159. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, -250, VBOTTOM, SalNumberToStrX( nTaxAmt, 2 ) )
  1160. .head 8 -  Call VpeSetAlign( hDoc, ALIGN_LEFT )
  1161. .head 8 -  Call VpeSelectFont( hDoc, 'Arial', 6 )
  1162. .head 8 -  Call VpeWriteBox( hDoc, VRIGHT, VTOP, VRIGHTMARGIN, VBOTTOM, sComment )
  1163. .head 8 -  Call VpeSelectFont( hDoc, 'Arial', 11 )
  1164. .head 8 -  Call VpeSetTransparentMode( hDoc, 0 )
  1165. .head 8 +  If VpeGet( hDoc, VBOTTOM ) + 150 > VpeGet( hDoc, VBOTTOMMARGIN )
  1166. .head 9 -  ! bottom of page reached
  1167. .head 9 -  Call PrintFooter( hDoc )
  1168. .head 9 -  Call PrintPageFooter( hDoc, sName, nPage )
  1169. .head 9 -  Call PageBreak( hDoc, nPage )
  1170. .head 9 -  Set nPage = nPage + 1
  1171. .head 9 -  Call PrintHeader( hDoc, sTableName )
  1172. .head 6 -  Call PrintFooter( hDoc )
  1173. .head 6 -  Call PrintPageFooter( hDoc, sName, nPage )
  1174. .head 6 -  Call VpeGotoPage( hDoc, 1 )
  1175. .head 6 -  Call VpeWriteBox( hDoc, 100, 100, 1000, 150, 'Generated ' || SalNumberToStrX( VpeGetPageCount( hDoc ), 0 ) || ' pages of demo data.' )
  1176. .head 6 -  Call dlgVpeDemo.Status( '' )
  1177. .head 6 -  Call VpePreviewDoc( hDoc, 0, 0, -1, -1, VPE_SHOW_MAXIMIZED )
  1178. .head 6 -  Set bRetVal = TRUE
  1179. .head 5 +  Else
  1180. .head 6 -  Call dlgVpeDemo.Status( 'ERROR: demo data table not found!' )
  1181. .head 5 -  Call SalWaitCursor( FALSE )
  1182. .head 5 -  Return bRetVal
  1183. .head 3 +  Function: Graph
  1184. .head 4 -  Description:
  1185. .head 4 -  Returns
  1186. .head 4 -  Parameters
  1187. .head 4 -  Static Variables
  1188. .head 4 +  Local variables
  1189. .head 5 -  Number: hDoc
  1190. .head 4 +  Actions
  1191. .head 5 -  Set hDoc = VpeOpenDoc( ghWndMain, "Precision + Capabilities", -1, -1, VPE_EMBEDDED | VPE_GRID_POSSIBLE | VPE_ROUTE_HELP )
  1192. .head 5 -  Set gnGraph = hDoc
  1193. .head 5 -  Call VpeSetFontAttr( hDoc, ALIGN_LEFT, 0, 1, 1 )
  1194. .head 5 -  Call VpeSetPen( hDoc, 0, _VPE_PS_SOLID, 0 )
  1195. .head 5 -  Call VpeDefineHeader( hDoc, 100, 100, 1000, 150, "Graphing / IDEAL Software" )
  1196. .head 5 -  Call VpeSetUnderlined( hDoc, 0 )
  1197. .head 5 -  Call SalWaitCursor( TRUE )
  1198. .head 5 -  Call page2( hDoc )
  1199. .head 5 -  Call SalWaitCursor( FALSE )
  1200. .head 5 -  Call VpeRemoveSet( hDoc, HEADLINE )
  1201. .head 5 -  Call VpeGotoPage( hDoc, 1 )
  1202. .head 5 -  Call VpePreviewDocTile( hDoc, VPE_SHOW_NORMAL )
  1203. .head 2 -  Named Menus
  1204. .head 2 +  Class Definitions
  1205. .head 2 +  Default Classes
  1206. .head 3 -  MDI Window: cBaseMDI
  1207. .head 3 -  Form Window:
  1208. .head 3 -  Dialog Box:
  1209. .head 3 -  Table Window:
  1210. .head 3 -  Quest Window:
  1211. .head 3 -  Data Field:
  1212. .head 3 -  Spin Field:
  1213. .head 3 -  Multiline Field: cQuickMLField
  1214. .head 3 -  Pushbutton: cQuickCommander
  1215. .head 3 -  Radio Button:
  1216. .head 3 -  Option Button:
  1217. .head 3 -  Check Box:
  1218. .head 3 -  Child Table: cQuickTable
  1219. .head 3 -  Quest Child Window: cQuickDatabase
  1220. .head 3 -  List Box:
  1221. .head 3 -  Combo Box:
  1222. .head 3 -  Picture: cQuickPicture
  1223. .head 3 -  Vertical Scroll Bar:
  1224. .head 3 -  Horizontal Scroll Bar:
  1225. .head 3 -  Column:
  1226. .head 3 -  Background Text:
  1227. .head 3 -  Group Box:
  1228. .head 3 -  Line:
  1229. .head 3 -  Frame:
  1230. .head 3 -  Custom Control: cQuickGraph
  1231. .head 2 -  Application Actions
  1232. .head 1 +  Form Window: frmVpeDemo
  1233. .head 2 -  Class:
  1234. .head 2 -  Property Template:
  1235. .head 2 -  Class DLL Name:
  1236. .head 2 -  Title: VPE
  1237. .head 2 -  Icon File:
  1238. .head 2 -  Accesories Enabled? No
  1239. .head 2 -  Visible? Yes
  1240. .head 2 -  Display Settings
  1241. .head 3 -  Display Style? Standard
  1242. .head 3 -  Visible at Design time? No
  1243. .head 3 -  Automatically Created at Runtime? Yes
  1244. .head 3 -  Initial State: Normal
  1245. .head 3 -  Maximizable? Yes
  1246. .head 3 -  Minimizable? Yes
  1247. .head 3 -  System Menu? Yes
  1248. .head 3 -  Resizable? Yes
  1249. .head 3 -  Window Location and Size
  1250. .head 4 -  Left:   Default
  1251. .head 4 -  Top:    Default
  1252. .head 4 -  Width:  Default
  1253. .head 4 -  Width Editable? Yes
  1254. .head 4 -  Height: Default
  1255. .head 4 -  Height Editable? Yes
  1256. .head 3 -  Form Size
  1257. .head 4 -  Width:  Default
  1258. .head 4 -  Height: Default
  1259. .head 4 -  Number of Pages: Dynamic
  1260. .head 3 -  Font Name: Default
  1261. .head 3 -  Font Size: Default
  1262. .head 3 -  Font Enhancement: Default
  1263. .head 3 -  Text Color: Default
  1264. .head 3 -  Background Color: Default
  1265. .head 2 -  Description:
  1266. .head 2 -  Named Menus
  1267. .head 2 -  Menu
  1268. .head 2 +  Tool Bar
  1269. .head 3 -  Display Settings
  1270. .head 4 -  Display Style? Default
  1271. .head 4 -  Location? Top
  1272. .head 4 -  Visible? Yes
  1273. .head 4 -  Size: Default
  1274. .head 4 -  Size Editable? Yes
  1275. .head 4 -  Font Name: Default
  1276. .head 4 -  Font Size: Default
  1277. .head 4 -  Font Enhancement: Default
  1278. .head 4 -  Text Color: Default
  1279. .head 4 -  Background Color: Default
  1280. .head 3 -  Contents
  1281. .head 2 -  Contents
  1282. .head 2 -  Functions
  1283. .head 2 -  Window Parameters
  1284. .head 2 +  Window Variables
  1285. .head 3 -  Boolean: bNoClose
  1286. .head 2 +  Message Actions
  1287. .head 3 +  On SAM_Create
  1288. .head 4 -  Call SalCreateWindow( dlgVpeDemo, hWndForm )
  1289. .head 4 -  Set ghWndMain = hWndForm
  1290. .head 4 -  Set bNoClose = FALSE
  1291. .head 3 +  On VPE_HELP
  1292. .head 4 -  Call SalMessageBox( "User requested help!", "Note:", MB_Ok )
  1293. .head 3 +  On VPE_DESTROYWINDOW
  1294. .head 4 +  If lParam = gnPrecision
  1295. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbClosePrecision, SAM_Click, 0, 0 )
  1296. .head 4 +  Else If lParam = gnGraph
  1297. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseGraph, SAM_Click, 0, 0 )
  1298. .head 4 +  Else If lParam = gnSpeed
  1299. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseSpeed, SAM_Click, 0, 0 )
  1300. .head 4 +  Else If lParam = gnColors
  1301. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseColors, SAM_Click, 0, 0 )
  1302. .head 4 +  Else If lParam = gnReport
  1303. .head 5 -  Call SalSendMsg( dlgVpeDemo.pbCloseReport, SAM_Click, 0, 0 )
  1304. .head 3 +  On VPE_PRINT
  1305. .head 4 +  If wParam
  1306. .head 5 -  Set bNoClose = TRUE
  1307. .head 4 +  Else
  1308. .head 5 -  Set bNoClose = FALSE
  1309. .head 5 +  If lParam = gnPBackGnd
  1310. .head 6 -  Call VpeCloseDoc( gnPBackGnd )
  1311. .head 6 -  Set gnPBackGnd = 0
  1312. .head 6 -  Call dlgVpeDemo.Status( 'Message: Background Processing finished.' )
  1313. .head 3 +  On VPE_PRINTCANCEL
  1314. .head 4 -  Set bNoClose = FALSE
  1315. .head 4 +  If lParam = gnPBackGnd
  1316. .head 5 -  Set gnPBackGnd = 0
  1317. .head 5 -  Call dlgVpeDemo.Status( 'Message: Background Processing aborted.' )
  1318. .head 3 +  On WM_SIZE
  1319. .head 4 +  If (gnPrecision) ! this is an embedded window
  1320. .head 5 -  Call MoveWindow( VpeWindowHandle( gnPrecision), 0, 0, SalNumberLow( lParam ), SalNumberHigh( lParam ), FALSE )
  1321. .head 5 -  Return 0
  1322. .head 4 +  Else If (gnGraph)
  1323. .head 5 -  Call MoveWindow( VpeWindowHandle( gnGraph), 0, 0, SalNumberLow( lParam ), SalNumberHigh( lParam ), FALSE )
  1324. .head 5 -  Return 0
  1325. .head 3 +  On WM_KEYDOWN
  1326. .head 4 +  If (gnPrecision) ! this is an embedded window
  1327. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnPrecision ), WM_KEYDOWN, wParam, lParam )
  1328. .head 5 -  Return 0
  1329. .head 4 +  Else If (gnGraph)
  1330. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnGraph ), WM_KEYDOWN, wParam, lParam )
  1331. .head 5 -  Return 0
  1332. .head 3 +  On SAM_Close
  1333. .head 4 +  If bNoClose ! can't close, because printing?
  1334. .head 5 -  Call SalMessageBox( "Can't close, job is printing!", "WARNING:", MB_Ok )
  1335. .head 5 -  Return FALSE
  1336. .head 4 +  Else
  1337. .head 5 +  If gnColors
  1338. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseColors, SAM_Click, 0, 0 )
  1339. .head 5 +  If gnReport
  1340. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseReport, SAM_Click, 0, 0 )
  1341. .head 5 +  If gnSpeed
  1342. .head 6 -  Call SalSendMsg( dlgVpeDemo.pbCloseSpeed, SAM_Click, 0, 0 )
  1343. .head 5 +  If gbTableCreated
  1344. .head 6 -  Call SqlPrepareAndExecute( ghSql, 'DROP TABLE #VPE_DEMO' )
  1345. .head 6 -  Call SqlCommit( ghSql )
  1346. .head 6 -  Call SqlDisconnect( ghSql )
  1347. .head 1 +  Dialog Box: dlgVpeDemo
  1348. .head 2 -  Class:
  1349. .head 2 -  Property Template:
  1350. .head 2 -  Class DLL Name:
  1351. .head 2 -  Title: Virtual Print Engine
  1352. .head 2 -  Accesories Enabled? No
  1353. .head 2 -  Visible? Yes
  1354. .head 2 -  Display Settings
  1355. .head 3 -  Display Style? Default
  1356. .head 3 -  Visible at Design time? No
  1357. .head 3 -  Type of Dialog: Modeless
  1358. .head 3 -  Window Location and Size
  1359. .head 4 -  Left:   2.35"
  1360. .head 4 -  Top:    1.823"
  1361. .head 4 -  Width:  6.367"
  1362. .head 4 -  Width Editable? Yes
  1363. .head 4 -  Height: 3.524"
  1364. .head 4 -  Height Editable? Yes
  1365. .head 3 -  Absolute Screen Location? Yes
  1366. .head 3 -  Font Name: Arial
  1367. .head 3 -  Font Size: 8
  1368. .head 3 -  Font Enhancement: Bold
  1369. .head 3 -  Text Color: Default
  1370. .head 3 -  Background Color: Default
  1371. .head 2 -  Description:
  1372. .head 2 +  Tool Bar
  1373. .head 3 -  Display Settings
  1374. .head 4 -  Display Style? Default
  1375. .head 4 -  Location? Top
  1376. .head 4 -  Visible? Yes
  1377. .head 4 -  Size: Default
  1378. .head 4 -  Size Editable? Yes
  1379. .head 4 -  Font Name: Default
  1380. .head 4 -  Font Size: Default
  1381. .head 4 -  Font Enhancement: Default
  1382. .head 4 -  Text Color: Default
  1383. .head 4 -  Background Color: Default
  1384. .head 3 -  Contents
  1385. .head 2 +  Contents
  1386. .head 3 +  Pushbutton: pbBackground
  1387. .head 4 -  Class Child Ref Key: 0
  1388. .head 4 -  Class ChildKey: 0
  1389. .head 4 -  Class:
  1390. .head 4 -  Property Template:
  1391. .head 4 -  Class DLL Name:
  1392. .head 4 -  Title: Background
  1393. .head 4 -  Window Location and Size
  1394. .head 5 -  Left:   0.433"
  1395. .head 5 -  Top:    0.143"
  1396. .head 5 -  Width:  1.333"
  1397. .head 5 -  Width Editable? Yes
  1398. .head 5 -  Height: 0.238"
  1399. .head 5 -  Height Editable? Yes
  1400. .head 4 -  Visible? Yes
  1401. .head 4 -  Keyboard Accelerator: (none)
  1402. .head 4 -  Font Name: Default
  1403. .head 4 -  Font Size: Default
  1404. .head 4 -  Font Enhancement: Default
  1405. .head 4 -  Picture File Name:
  1406. .head 4 -  Picture Transparent Color: None
  1407. .head 4 -  Image Style: Single
  1408. .head 4 -  Text Color: Default
  1409. .head 4 -  Background Color: Default
  1410. .head 4 +  Message Actions
  1411. .head 5 +  On SAM_Click
  1412. .head 6 -  Call Status( 'Here no preview is shown. Also no printer-setup is done - setting of the standard printer or of your last setup in VPE is taken' )
  1413. .head 6 -  Call SalDisableWindow( hWndItem )
  1414. .head 6 -  Call Precision( 1 )
  1415. .head 6 -  Call SalEnableWindow( hWndItem )
  1416. .head 3 +  Pushbutton: pbPrecision
  1417. .head 4 -  Class Child Ref Key: 0
  1418. .head 4 -  Class ChildKey: 0
  1419. .head 4 -  Class:
  1420. .head 4 -  Property Template:
  1421. .head 4 -  Class DLL Name:
  1422. .head 4 -  Title: Capabilities + Precision
  1423. .head 4 -  Window Location and Size
  1424. .head 5 -  Left:   1.883"
  1425. .head 5 -  Top:    0.119"
  1426. .head 5 -  Width:  2.567"
  1427. .head 5 -  Width Editable? Yes
  1428. .head 5 -  Height: 0.292"
  1429. .head 5 -  Height Editable? Yes
  1430. .head 4 -  Visible? Yes
  1431. .head 4 -  Keyboard Accelerator: (none)
  1432. .head 4 -  Font Name: Default
  1433. .head 4 -  Font Size: Default
  1434. .head 4 -  Font Enhancement: Default
  1435. .head 4 -  Picture File Name:
  1436. .head 4 -  Picture Transparent Color: None
  1437. .head 4 -  Image Style: Single
  1438. .head 4 -  Text Color: Default
  1439. .head 4 -  Background Color: Default
  1440. .head 4 +  Message Actions
  1441. .head 5 +  On SAM_Click
  1442. .head 6 +  If gnPrecision
  1443. .head 7 -  Call Status( 'Precision test is already running' )
  1444. .head 6 +  Else
  1445. .head 7 -  Call Status( 'The window titled \'VPE\' is the application\'s main window. It\'s content is an embedded window from the VPE-DLL!!! ' || 
  1446. 'You just need about 12 lines of code!' )
  1447. .head 7 -  Call Precision( 0 )
  1448. .head 7 -  Call SalEnableWindow( pbClosePrecision )
  1449. .head 7 -  Call SalEnableWindow( pbPreviousPage )
  1450. .head 7 -  Call SalEnableWindow( pbNextPage )
  1451. .head 3 +  Pushbutton: pbClosePrecision
  1452. .head 4 -  Class Child Ref Key: 0
  1453. .head 4 -  Class ChildKey: 0
  1454. .head 4 -  Class:
  1455. .head 4 -  Property Template:
  1456. .head 4 -  Class DLL Name:
  1457. .head 4 -  Title: Close
  1458. .head 4 -  Window Location and Size
  1459. .head 5 -  Left:   4.633"
  1460. .head 5 -  Top:    0.143"
  1461. .head 5 -  Width:  0.767"
  1462. .head 5 -  Width Editable? Yes
  1463. .head 5 -  Height: 0.238"
  1464. .head 5 -  Height Editable? Yes
  1465. .head 4 -  Visible? Yes
  1466. .head 4 -  Keyboard Accelerator: (none)
  1467. .head 4 -  Font Name: Default
  1468. .head 4 -  Font Size: Default
  1469. .head 4 -  Font Enhancement: Default
  1470. .head 4 -  Picture File Name:
  1471. .head 4 -  Picture Transparent Color: None
  1472. .head 4 -  Image Style: Single
  1473. .head 4 -  Text Color: Default
  1474. .head 4 -  Background Color: Default
  1475. .head 4 +  Message Actions
  1476. .head 5 +  On SAM_Create
  1477. .head 6 -  Call SalDisableWindow( hWndItem )
  1478. .head 5 +  On SAM_Click
  1479. .head 6 +  If NOT VpeCloseDoc( gnPrecision )
  1480. .head 7 -  Call Status( 'Can\'t close, task \'precision test\' is currently printing' )
  1481. .head 6 +  Else
  1482. .head 7 -  Call SalDisableWindow( hWndItem )
  1483. .head 7 -  Call SalDisableWindow( pbPreviousPage )
  1484. .head 7 -  Call SalDisableWindow( pbNextPage )
  1485. .head 7 -  Set gnPrecision = 0
  1486. .head 3 +  Pushbutton: pbPreviousPage
  1487. .head 4 -  Class Child Ref Key: 0
  1488. .head 4 -  Class ChildKey: 0
  1489. .head 4 -  Class:
  1490. .head 4 -  Property Template:
  1491. .head 4 -  Class DLL Name:
  1492. .head 4 -  Title: <<
  1493. .head 4 -  Window Location and Size
  1494. .head 5 -  Left:   2.6"
  1495. .head 5 -  Top:    0.476"
  1496. .head 5 -  Width:  0.483"
  1497. .head 5 -  Width Editable? Yes
  1498. .head 5 -  Height: 0.238"
  1499. .head 5 -  Height Editable? Yes
  1500. .head 4 -  Visible? Yes
  1501. .head 4 -  Keyboard Accelerator: (none)
  1502. .head 4 -  Font Name: Default
  1503. .head 4 -  Font Size: Default
  1504. .head 4 -  Font Enhancement: Default
  1505. .head 4 -  Picture File Name:
  1506. .head 4 -  Picture Transparent Color: None
  1507. .head 4 -  Image Style: Single
  1508. .head 4 -  Text Color: Default
  1509. .head 4 -  Background Color: Default
  1510. .head 4 +  Message Actions
  1511. .head 5 +  On SAM_Create
  1512. .head 6 -  Call SalDisableWindow( hWndItem )
  1513. .head 5 +  On SAM_Click
  1514. .head 6 -  Call VpeSetUpdate( gnPrecision, TRUE )
  1515. .head 6 -  Call VpeGotoPage( gnPrecision, VpeGetCurrentPage( gnPrecision ) - 1 )
  1516. .head 6 -  Call VpeSetUpdate( gnPrecision, FALSE )
  1517. .head 3 +  Pushbutton: pbNextPage
  1518. .head 4 -  Class Child Ref Key: 0
  1519. .head 4 -  Class ChildKey: 0
  1520. .head 4 -  Class:
  1521. .head 4 -  Property Template:
  1522. .head 4 -  Class DLL Name:
  1523. .head 4 -  Title: >>
  1524. .head 4 -  Window Location and Size
  1525. .head 5 -  Left:   3.133"
  1526. .head 5 -  Top:    0.476"
  1527. .head 5 -  Width:  0.483"
  1528. .head 5 -  Width Editable? Yes
  1529. .head 5 -  Height: 0.238"
  1530. .head 5 -  Height Editable? Yes
  1531. .head 4 -  Visible? Yes
  1532. .head 4 -  Keyboard Accelerator: (none)
  1533. .head 4 -  Font Name: Default
  1534. .head 4 -  Font Size: Default
  1535. .head 4 -  Font Enhancement: Default
  1536. .head 4 -  Picture File Name:
  1537. .head 4 -  Picture Transparent Color: None
  1538. .head 4 -  Image Style: Single
  1539. .head 4 -  Text Color: Default
  1540. .head 4 -  Background Color: Default
  1541. .head 4 +  Message Actions
  1542. .head 5 +  On SAM_Create
  1543. .head 6 -  Call SalDisableWindow( hWndItem )
  1544. .head 5 +  On SAM_Click
  1545. .head 6 -  Call VpeSetUpdate( gnPrecision, TRUE )
  1546. .head 6 -  Call VpeGotoPage( gnPrecision, VpeGetCurrentPage( gnPrecision ) + 1 )
  1547. .head 6 -  Call VpeSetUpdate( gnPrecision, FALSE )
  1548. .head 3 +  Pushbutton: pbGraph
  1549. .head 4 -  Class Child Ref Key: 0
  1550. .head 4 -  Class ChildKey: 0
  1551. .head 4 -  Class:
  1552. .head 4 -  Property Template:
  1553. .head 4 -  Class DLL Name:
  1554. .head 4 -  Title: Graphing
  1555. .head 4 -  Window Location and Size
  1556. .head 5 -  Left:   1.883"
  1557. .head 5 -  Top:    0.762"
  1558. .head 5 -  Width:  2.567"
  1559. .head 5 -  Width Editable? Yes
  1560. .head 5 -  Height: 0.292"
  1561. .head 5 -  Height Editable? Yes
  1562. .head 4 -  Visible? Yes
  1563. .head 4 -  Keyboard Accelerator: (none)
  1564. .head 4 -  Font Name: Default
  1565. .head 4 -  Font Size: Default
  1566. .head 4 -  Font Enhancement: Default
  1567. .head 4 -  Picture File Name:
  1568. .head 4 -  Picture Transparent Color: None
  1569. .head 4 -  Image Style: Single
  1570. .head 4 -  Text Color: Default
  1571. .head 4 -  Background Color: Default
  1572. .head 4 +  Message Actions
  1573. .head 5 +  On SAM_Click
  1574. .head 6 +  If gnGraph
  1575. .head 7 -  Call Status( 'Graphing demo already running' )
  1576. .head 6 +  Else
  1577. .head 7 -  Call Status( 'A demonstration of VPE\'s graphing capabilities will appear in the main window. The calculations take a short time. Once computed, VPE can display the graph incredibly fast.' )
  1578. .head 7 -  Call Graph(  )
  1579. .head 7 -  Call SalEnableWindow( pbCloseGraph )
  1580. .head 3 +  Pushbutton: pbCloseGraph
  1581. .head 4 -  Class Child Ref Key: 0
  1582. .head 4 -  Class ChildKey: 0
  1583. .head 4 -  Class:
  1584. .head 4 -  Property Template:
  1585. .head 4 -  Class DLL Name:
  1586. .head 4 -  Title: Close
  1587. .head 4 -  Window Location and Size
  1588. .head 5 -  Left:   4.633"
  1589. .head 5 -  Top:    0.786"
  1590. .head 5 -  Width:  0.767"
  1591. .head 5 -  Width Editable? Yes
  1592. .head 5 -  Height: 0.238"
  1593. .head 5 -  Height Editable? Yes
  1594. .head 4 -  Visible? Yes
  1595. .head 4 -  Keyboard Accelerator: (none)
  1596. .head 4 -  Font Name: Default
  1597. .head 4 -  Font Size: Default
  1598. .head 4 -  Font Enhancement: Default
  1599. .head 4 -  Picture File Name:
  1600. .head 4 -  Picture Transparent Color: None
  1601. .head 4 -  Image Style: Single
  1602. .head 4 -  Text Color: Default
  1603. .head 4 -  Background Color: Default
  1604. .head 4 +  Message Actions
  1605. .head 5 +  On SAM_Create
  1606. .head 6 -  Call SalDisableWindow( hWndItem )
  1607. .head 5 +  On SAM_Click
  1608. .head 6 +  If NOT VpeCloseDoc( gnGraph )
  1609. .head 7 -  Call Status( 'Can\'t close, task \'Graphing\' is currently printing' )
  1610. .head 6 +  Else
  1611. .head 7 -  Call SalDisableWindow( hWndItem )
  1612. .head 7 -  Set gnGraph = 0
  1613. .head 3 +  ! Pushbutton: pbGenerateReport
  1614. .winattr
  1615. .head 4 -  Class Child Ref Key: 0
  1616. .head 4 -  Class ChildKey: 0
  1617. .head 4 -  Class:
  1618. .head 4 -  Property Template:
  1619. .head 4 -  Class DLL Name:
  1620. .head 4 -  Title: Generate Report
  1621. .head 4 -  Window Location and Size
  1622. .head 5 -  Left:   0.183"
  1623. .head 5 -  Top:    0.726"
  1624. .head 5 -  Width:  1.613"
  1625. .head 5 -  Width Editable? Yes
  1626. .head 5 -  Height: 0.238"
  1627. .head 5 -  Height Editable? Yes
  1628. .head 4 -  Visible? Yes
  1629. .head 4 -  Keyboard Accelerator: (none)
  1630. .head 4 -  Font Name: Default
  1631. .head 4 -  Font Size: Default
  1632. .head 4 -  Font Enhancement: Default
  1633. .head 4 -  Picture File Name:
  1634. .head 4 -  Picture Transparent Color: None
  1635. .head 4 -  Image Style: Single
  1636. .head 4 -  Text Color: Default
  1637. .head 4 -  Background Color: Default
  1638. .end
  1639. .head 4 +  Message Actions 
  1640. .head 5 +  On SAM_Click
  1641. .head 6 -  Call GenerateReport(  )
  1642. .head 3 +  ! Pushbutton: pbDeleteReport
  1643. .winattr
  1644. .head 4 -  Class Child Ref Key: 0
  1645. .head 4 -  Class ChildKey: 0
  1646. .head 4 -  Class:
  1647. .head 4 -  Property Template:
  1648. .head 4 -  Class DLL Name:
  1649. .head 4 -  Title: Delete Report
  1650. .head 4 -  Window Location and Size
  1651. .head 5 -  Left:   0.183"
  1652. .head 5 -  Top:    0.976"
  1653. .head 5 -  Width:  1.617"
  1654. .head 5 -  Width Editable? Yes
  1655. .head 5 -  Height: 0.238"
  1656. .head 5 -  Height Editable? Yes
  1657. .head 4 -  Visible? Yes
  1658. .head 4 -  Keyboard Accelerator: (none)
  1659. .head 4 -  Font Name: Default
  1660. .head 4 -  Font Size: Default
  1661. .head 4 -  Font Enhancement: Default
  1662. .head 4 -  Picture File Name:
  1663. .head 4 -  Picture Transparent Color: None
  1664. .head 4 -  Image Style: Single
  1665. .head 4 -  Text Color: Default
  1666. .head 4 -  Background Color: Default
  1667. .end
  1668. .head 4 +  Message Actions 
  1669. .head 5 +  On SAM_Click
  1670. .head 6 -  Call SalFileOpen( hFileRpt, RPT_PATH, OF_Delete )
  1671. .head 3 +  Pushbutton: pbSpeed
  1672. .head 4 -  Class Child Ref Key: 0
  1673. .head 4 -  Class ChildKey: 0
  1674. .head 4 -  Class:
  1675. .head 4 -  Property Template:
  1676. .head 4 -  Class DLL Name:
  1677. .head 4 -  Title: Speed + Tables...
  1678. .head 4 -  Window Location and Size
  1679. .head 5 -  Left:   1.883"
  1680. .head 5 -  Top:    1.119"
  1681. .head 5 -  Width:  2.567"
  1682. .head 5 -  Width Editable? Yes
  1683. .head 5 -  Height: 0.292"
  1684. .head 5 -  Height Editable? Yes
  1685. .head 4 -  Visible? Yes
  1686. .head 4 -  Keyboard Accelerator: (none)
  1687. .head 4 -  Font Name: Default
  1688. .head 4 -  Font Size: Default
  1689. .head 4 -  Font Enhancement: Default
  1690. .head 4 -  Picture File Name:
  1691. .head 4 -  Picture Transparent Color: None
  1692. .head 4 -  Image Style: Single
  1693. .head 4 -  Text Color: Default
  1694. .head 4 -  Background Color: Default
  1695. .head 4 +  Message Actions
  1696. .head 5 +  On SAM_Click
  1697. .head 6 +  If gnSpeed
  1698. .head 7 -  Call Status( 'Speed and Tables demo already running' )
  1699. .head 6 +  Else
  1700. .head 7 +  If NOT gbTableCreated
  1701. .head 8 -  Set sDatabase = 'GUPTA'
  1702. .head 8 -  Set sUser = 'SYSADM'
  1703. .head 8 -  Set sPassword = 'SYSADM'
  1704. .head 8 +  If SalModalDialog( dlgVpeLogin, hWndForm, sDatabase, sUser, sPassword )
  1705. .head 9 -  Set SqlDatabase = sDatabase
  1706. .head 9 -  Set SqlUser = sUser
  1707. .head 9 -  Set SqlPassword = sPassword
  1708. .head 9 +  When SqlError
  1709. .head 10 -  Call SalMessageBox( 'Database connection failed. Please ensure you are using a valid combination of database name, user name and password with the rights to create a table.', 'VPE Demo Database Login', MB_Ok )
  1710. .head 10 -  Return FALSE
  1711. .head 9 +  If SqlConnect( ghSql )
  1712. .head 10 +  When SqlError
  1713. .head 11 -  Return FALSE
  1714. .head 10 -  Set sSql = 
  1715. 'CREATE TABLE #VPE_DEMO (TABLE_NAME VARCHAR(9), TABLE_COUNT INT, TABLE_DATE DATE, AMOUNT DECIMAL(8,2), PRORATED_AMT DECIMAL(8,2), TAX_AMT DECIMAL(8,2), USER_COMMENT VARCHAR(200) )'
  1716. .head 10 +  If SqlPrepareAndExecute( ghSql, sSql )
  1717. .head 11 -  Call SqlCommit( ghSql )
  1718. .head 11 -  Call Status( 'Generating report demo data. This data will be deleted when you exit the demo. Please wait.' )
  1719. .head 11 -  Call GenerateData(  )
  1720. .head 11 -  Set gbTableCreated = TRUE
  1721. .head 10 +  Else
  1722. .head 11 -  Call SalMessageBox( 'VPE Demo was unable to create the table in the database for setting up the demo data. Please ensure that the user ID has sufficient rights to create a table in the database.', 'VPE Demo CREATE TABLE failed', MB_Ok )
  1723. .head 7 +  If gbTableCreated
  1724. .head 8 -  Call Status( 'Creating report from the database.' )
  1725. .head 8 -  Call PrintJournal(  )
  1726. .head 8 -  Call SalEnableWindow( pbCloseSpeed )
  1727. .head 3 +  Pushbutton: pbCloseSpeed
  1728. .head 4 -  Class Child Ref Key: 0
  1729. .head 4 -  Class ChildKey: 0
  1730. .head 4 -  Class:
  1731. .head 4 -  Property Template:
  1732. .head 4 -  Class DLL Name:
  1733. .head 4 -  Title: Close
  1734. .head 4 -  Window Location and Size
  1735. .head 5 -  Left:   4.633"
  1736. .head 5 -  Top:    1.143"
  1737. .head 5 -  Width:  0.767"
  1738. .head 5 -  Width Editable? Yes
  1739. .head 5 -  Height: 0.238"
  1740. .head 5 -  Height Editable? Yes
  1741. .head 4 -  Visible? Yes
  1742. .head 4 -  Keyboard Accelerator: (none)
  1743. .head 4 -  Font Name: Default
  1744. .head 4 -  Font Size: Default
  1745. .head 4 -  Font Enhancement: Default
  1746. .head 4 -  Picture File Name:
  1747. .head 4 -  Picture Transparent Color: None
  1748. .head 4 -  Image Style: Single
  1749. .head 4 -  Text Color: Default
  1750. .head 4 -  Background Color: Default
  1751. .head 4 +  Message Actions
  1752. .head 5 +  On SAM_Create
  1753. .head 6 -  Call SalDisableWindow( hWndItem )
  1754. .head 5 +  On SAM_Click
  1755. .head 6 +  If NOT VpeCloseDoc( gnSpeed )
  1756. .head 7 -  Call Status( 'Can\'t close, task \'Speed and Tables\' is currently printing' )
  1757. .head 6 +  Else
  1758. .head 7 -  Call SalDisableWindow( hWndItem )
  1759. .head 7 -  Set gnSpeed = 0
  1760. .head 3 +  Pushbutton: pbColors
  1761. .head 4 -  Class Child Ref Key: 0
  1762. .head 4 -  Class ChildKey: 0
  1763. .head 4 -  Class:
  1764. .head 4 -  Property Template:
  1765. .head 4 -  Class DLL Name:
  1766. .head 4 -  Title: Colors
  1767. .head 4 -  Window Location and Size
  1768. .head 5 -  Left:   1.883"
  1769. .head 5 -  Top:    1.476"
  1770. .head 5 -  Width:  2.567"
  1771. .head 5 -  Width Editable? Yes
  1772. .head 5 -  Height: 0.292"
  1773. .head 5 -  Height Editable? Yes
  1774. .head 4 -  Visible? Yes
  1775. .head 4 -  Keyboard Accelerator: (none)
  1776. .head 4 -  Font Name: Default
  1777. .head 4 -  Font Size: Default
  1778. .head 4 -  Font Enhancement: Default
  1779. .head 4 -  Picture File Name:
  1780. .head 4 -  Picture Transparent Color: None
  1781. .head 4 -  Image Style: Single
  1782. .head 4 -  Text Color: Default
  1783. .head 4 -  Background Color: Default
  1784. .head 4 +  Message Actions
  1785. .head 5 +  On SAM_Click
  1786. .head 6 +  If gnColors
  1787. .head 7 -  Call Status( 'Color test is already running' )
  1788. .head 6 +  Else
  1789. .head 7 -  Call SalWaitCursor( TRUE )
  1790. .head 7 -  Call colortest(  )
  1791. .head 7 -  Call SalWaitCursor( FALSE )
  1792. .head 7 -  Call SalEnableWindow( pbCloseColors )
  1793. .head 3 +  Pushbutton: pbCloseColors
  1794. .head 4 -  Class Child Ref Key: 0
  1795. .head 4 -  Class ChildKey: 0
  1796. .head 4 -  Class:
  1797. .head 4 -  Property Template:
  1798. .head 4 -  Class DLL Name:
  1799. .head 4 -  Title: Close
  1800. .head 4 -  Window Location and Size
  1801. .head 5 -  Left:   4.633"
  1802. .head 5 -  Top:    1.5"
  1803. .head 5 -  Width:  0.767"
  1804. .head 5 -  Width Editable? Yes
  1805. .head 5 -  Height: 0.238"
  1806. .head 5 -  Height Editable? Yes
  1807. .head 4 -  Visible? Yes
  1808. .head 4 -  Keyboard Accelerator: (none)
  1809. .head 4 -  Font Name: Default
  1810. .head 4 -  Font Size: Default
  1811. .head 4 -  Font Enhancement: Default
  1812. .head 4 -  Picture File Name:
  1813. .head 4 -  Picture Transparent Color: None
  1814. .head 4 -  Image Style: Single
  1815. .head 4 -  Text Color: Default
  1816. .head 4 -  Background Color: Default
  1817. .head 4 +  Message Actions
  1818. .head 5 +  On SAM_Create
  1819. .head 6 -  Call SalDisableWindow( hWndItem )
  1820. .head 5 +  On SAM_Click
  1821. .head 6 +  If NOT VpeCloseDoc( gnColors )
  1822. .head 7 -  Call Status( 'Can\'t close, task \'color test\' is currently printing' )
  1823. .head 6 +  Else
  1824. .head 7 -  Call SalDisableWindow( hWndItem )
  1825. .head 7 -  Set gnColors = 0
  1826. .head 3 +  Pushbutton: pbReport
  1827. .head 4 -  Class Child Ref Key: 0
  1828. .head 4 -  Class ChildKey: 0
  1829. .head 4 -  Class:
  1830. .head 4 -  Property Template:
  1831. .head 4 -  Class DLL Name:
  1832. .head 4 -  Title: Report
  1833. .head 4 -  Window Location and Size
  1834. .head 5 -  Left:   1.883"
  1835. .head 5 -  Top:    1.821"
  1836. .head 5 -  Width:  2.567"
  1837. .head 5 -  Width Editable? Yes
  1838. .head 5 -  Height: 0.292"
  1839. .head 5 -  Height Editable? Yes
  1840. .head 4 -  Visible? Yes
  1841. .head 4 -  Keyboard Accelerator: (none)
  1842. .head 4 -  Font Name: Default
  1843. .head 4 -  Font Size: Default
  1844. .head 4 -  Font Enhancement: Default
  1845. .head 4 -  Picture File Name:
  1846. .head 4 -  Picture Transparent Color: None
  1847. .head 4 -  Image Style: Single
  1848. .head 4 -  Text Color: Default
  1849. .head 4 -  Background Color: Default
  1850. .head 4 +  Message Actions
  1851. .head 5 +  On SAM_Click
  1852. .head 6 +  If gnReport
  1853. .head 7 -  Call Status( 'Report test is already running' )
  1854. .head 6 +  Else
  1855. .head 7 -  Call reporttest(  )
  1856. .head 7 -  Call SalEnableWindow( pbCloseReport )
  1857. .head 3 +  Pushbutton: pbCloseReport
  1858. .head 4 -  Class Child Ref Key: 0
  1859. .head 4 -  Class ChildKey: 0
  1860. .head 4 -  Class:
  1861. .head 4 -  Property Template:
  1862. .head 4 -  Class DLL Name:
  1863. .head 4 -  Title: Close
  1864. .head 4 -  Window Location and Size
  1865. .head 5 -  Left:   4.633"
  1866. .head 5 -  Top:    1.845"
  1867. .head 5 -  Width:  0.767"
  1868. .head 5 -  Width Editable? Yes
  1869. .head 5 -  Height: 0.238"
  1870. .head 5 -  Height Editable? Yes
  1871. .head 4 -  Visible? Yes
  1872. .head 4 -  Keyboard Accelerator: (none)
  1873. .head 4 -  Font Name: Default
  1874. .head 4 -  Font Size: Default
  1875. .head 4 -  Font Enhancement: Default
  1876. .head 4 -  Picture File Name:
  1877. .head 4 -  Picture Transparent Color: None
  1878. .head 4 -  Image Style: Single
  1879. .head 4 -  Text Color: Default
  1880. .head 4 -  Background Color: Default
  1881. .head 4 +  Message Actions
  1882. .head 5 +  On SAM_Create
  1883. .head 6 -  Call SalDisableWindow( hWndItem )
  1884. .head 5 +  On SAM_Click
  1885. .head 6 +  If NOT VpeCloseDoc( gnReport )
  1886. .head 7 -  Call Status( 'Can\'t close, task \'report test\' is currently printing' )
  1887. .head 6 +  Else
  1888. .head 7 -  Call SalDisableWindow( hWndItem )
  1889. .head 7 -  Set gnReport = 0
  1890. .head 3 +  Pushbutton: pbExit
  1891. .head 4 -  Class Child Ref Key: 0
  1892. .head 4 -  Class ChildKey: 0
  1893. .head 4 -  Class:
  1894. .head 4 -  Property Template:
  1895. .head 4 -  Class DLL Name:
  1896. .head 4 -  Title: Exit
  1897. .head 4 -  Window Location and Size
  1898. .head 5 -  Left:   2.617"
  1899. .head 5 -  Top:    2.179"
  1900. .head 5 -  Width:  1.1"
  1901. .head 5 -  Width Editable? Yes
  1902. .head 5 -  Height: 0.292"
  1903. .head 5 -  Height Editable? Yes
  1904. .head 4 -  Visible? Yes
  1905. .head 4 -  Keyboard Accelerator: (none)
  1906. .head 4 -  Font Name: Default
  1907. .head 4 -  Font Size: Default
  1908. .head 4 -  Font Enhancement: Default
  1909. .head 4 -  Picture File Name:
  1910. .head 4 -  Picture Transparent Color: None
  1911. .head 4 -  Image Style: Single
  1912. .head 4 -  Text Color: Default
  1913. .head 4 -  Background Color: Default
  1914. .head 4 +  Message Actions
  1915. .head 5 +  On SAM_Click
  1916. .head 6 -  Call SalSendMsg( ghWndMain, SAM_Close, 0, 0 )
  1917. .head 3 +  Multiline Field: mlStatus
  1918. .head 4 -  Class Child Ref Key: 0
  1919. .head 4 -  Class ChildKey: 0
  1920. .head 4 -  Class:
  1921. .head 4 -  Property Template:
  1922. .head 4 -  Class DLL Name:
  1923. .head 4 -  Data
  1924. .head 5 -  Maximum Data Length: 1000
  1925. .head 5 -  String Type: String
  1926. .head 5 -  Editable? Yes
  1927. .head 4 -  Display Settings
  1928. .head 5 -  Border? No
  1929. .head 5 -  Word Wrap? Yes
  1930. .head 5 -  Vertical Scroll? No
  1931. .head 5 -  Window Location and Size
  1932. .head 6 -  Left:   0.233"
  1933. .head 6 -  Top:    2.548"
  1934. .head 6 -  Width:  5.85"
  1935. .head 6 -  Width Editable? Yes
  1936. .head 6 -  Height: 0.643"
  1937. .head 6 -  Height Editable? Yes
  1938. .head 5 -  Visible? Yes
  1939. .head 5 -  Font Name: Default
  1940. .head 5 -  Font Size: Default
  1941. .head 5 -  Font Enhancement: Default
  1942. .head 5 -  Text Color: Default
  1943. .head 5 -  Background Color: Gray
  1944. .head 4 +  Message Actions
  1945. .head 5 +  On SAM_Create
  1946. .head 6 -  Call SalDisableWindow( hWndItem )
  1947. .head 2 +  Functions
  1948. .head 3 +  Function: Status
  1949. .head 4 -  Description:
  1950. .head 4 -  Returns
  1951. .head 4 +  Parameters
  1952. .head 5 -  String: sStatusText
  1953. .head 4 -  Static Variables
  1954. .head 4 -  Local variables
  1955. .head 4 +  Actions
  1956. .head 5 -  Set mlStatus = sStatusText
  1957. .head 2 -  Window Parameters
  1958. .head 2 +  Window Variables
  1959. .head 3 -  String: sDatabase
  1960. .head 3 -  String: sUser
  1961. .head 3 -  String: sPassword
  1962. .head 3 -  String: sSql
  1963. .head 2 +  Message Actions
  1964. .head 3 +  On WM_COMMAND
  1965. .head 4 -  Call Status( '' )
  1966. .head 3 +  On WM_KEYDOWN
  1967. .head 4 +  If (gnPrecision) ! this is an embedded window
  1968. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnPrecision ), WM_KEYDOWN, wParam, lParam )
  1969. .head 5 -  Return 0
  1970. .head 4 +  Else If (gnGraph)
  1971. .head 5 -  Call SalSendMsg( VpeWindowHandle( gnGraph ), WM_KEYDOWN, wParam, lParam )
  1972. .head 5 -  Return 0
  1973. .head 3 +  On SAM_Create
  1974. .head 4 -  Set gbTableCreated = FALSE
  1975. .head 1 +  Dialog Box: dlgVpeLogin
  1976. .head 2 -  Class:
  1977. .head 2 -  Property Template:
  1978. .head 2 -  Class DLL Name:
  1979. .head 2 -  Title: VPE Demo Database Login
  1980. .head 2 -  Accesories Enabled? No
  1981. .head 2 -  Visible? Yes
  1982. .head 2 -  Display Settings
  1983. .head 3 -  Display Style? Default
  1984. .head 3 -  Visible at Design time? No
  1985. .head 3 -  Type of Dialog: Modal
  1986. .head 3 -  Window Location and Size
  1987. .head 4 -  Left:   1.413"
  1988. .head 4 -  Top:    1.083"
  1989. .head 4 -  Width:  6.267"
  1990. .head 4 -  Width Editable? Yes
  1991. .head 4 -  Height: 3.417"
  1992. .head 4 -  Height Editable? Yes
  1993. .head 3 -  Absolute Screen Location? No
  1994. .head 3 -  Font Name: Arial
  1995. .head 3 -  Font Size: 8
  1996. .head 3 -  Font Enhancement: Default
  1997. .head 3 -  Text Color: Default
  1998. .head 3 -  Background Color: Default
  1999. .head 2 -  Description:
  2000. .head 2 +  Tool Bar
  2001. .head 3 -  Display Settings
  2002. .head 4 -  Display Style? Default
  2003. .head 4 -  Location? Top
  2004. .head 4 -  Visible? Yes
  2005. .head 4 -  Size: Default
  2006. .head 4 -  Size Editable? Yes
  2007. .head 4 -  Font Name: Default
  2008. .head 4 -  Font Size: Default
  2009. .head 4 -  Font Enhancement: Default
  2010. .head 4 -  Text Color: Default
  2011. .head 4 -  Background Color: Default
  2012. .head 3 -  Contents
  2013. .head 2 +  Contents
  2014. .head 3 -  Background Text: This part of the VPE demo shows how VPE can be used to generate reports from a SQL database.
  2015.  
  2016. VPE Demo needs to connect to a database with a user ID that has the rights to create a new table. The table will be deleted upon completion of this part of the demo. 
  2017.  
  2018. Please provide connection information. The default values are suitable for a standard SQLWindows 5.0 installation.
  2019. .head 4 -  Resource Id: 4310
  2020. .head 4 -  Class Child Ref Key: 0
  2021. .head 4 -  Class ChildKey: 0
  2022. .head 4 -  Class:
  2023. .head 4 -  Window Location and Size
  2024. .head 5 -  Left:   0.383"
  2025. .head 5 -  Top:    0.048"
  2026. .head 5 -  Width:  5.333"
  2027. .head 5 -  Width Editable? Yes
  2028. .head 5 -  Height: 1.512"
  2029. .head 5 -  Height Editable? Yes
  2030. .head 4 -  Visible? Yes
  2031. .head 4 -  Justify: Left
  2032. .head 4 -  Font Name: Default
  2033. .head 4 -  Font Size: Default
  2034. .head 4 -  Font Enhancement: Bold
  2035. .head 4 -  Text Color: Default
  2036. .head 4 -  Background Color: Default
  2037. .head 3 -  Background Text: &Database:
  2038. .head 4 -  Resource Id: 4311
  2039. .head 4 -  Class Child Ref Key: 0
  2040. .head 4 -  Class ChildKey: 0
  2041. .head 4 -  Class:
  2042. .head 4 -  Window Location and Size
  2043. .head 5 -  Left:   1.3"
  2044. .head 5 -  Top:    1.714"
  2045. .head 5 -  Width:  0.867"
  2046. .head 5 -  Width Editable? Yes
  2047. .head 5 -  Height: 0.167"
  2048. .head 5 -  Height Editable? Yes
  2049. .head 4 -  Visible? Yes
  2050. .head 4 -  Justify: Left
  2051. .head 4 -  Font Name: Default
  2052. .head 4 -  Font Size: Default
  2053. .head 4 -  Font Enhancement: Default
  2054. .head 4 -  Text Color: Default
  2055. .head 4 -  Background Color: Default
  2056. .head 3 +  Data Field: dfDatabase
  2057. .head 4 -  Class Child Ref Key: 0
  2058. .head 4 -  Class ChildKey: 0
  2059. .head 4 -  Class:
  2060. .head 4 -  Property Template:
  2061. .head 4 -  Class DLL Name:
  2062. .head 4 -  Data
  2063. .head 5 -  Maximum Data Length: Default
  2064. .head 5 -  Data Type: String
  2065. .head 5 -  Editable? Yes
  2066. .head 4 -  Display Settings
  2067. .head 5 -  Window Location and Size
  2068. .head 6 -  Left:   2.667"
  2069. .head 6 -  Top:    1.679"
  2070. .head 6 -  Width:  1.983"
  2071. .head 6 -  Width Editable? Yes
  2072. .head 6 -  Height: 0.25"
  2073. .head 6 -  Height Editable? Yes
  2074. .head 5 -  Visible? Yes
  2075. .head 5 -  Border? Yes
  2076. .head 5 -  Justify: Left
  2077. .head 5 -  Format: Unformatted
  2078. .head 5 -  Country: Default
  2079. .head 5 -  Font Name: Default
  2080. .head 5 -  Font Size: Default
  2081. .head 5 -  Font Enhancement: Default
  2082. .head 5 -  Text Color: Default
  2083. .head 5 -  Background Color: Default
  2084. .head 5 -  Input Mask: Unformatted
  2085. .head 4 -  Message Actions
  2086. .head 3 -  Background Text: &User:
  2087. .head 4 -  Resource Id: 4312
  2088. .head 4 -  Class Child Ref Key: 0
  2089. .head 4 -  Class ChildKey: 0
  2090. .head 4 -  Class:
  2091. .head 4 -  Window Location and Size
  2092. .head 5 -  Left:   1.3"
  2093. .head 5 -  Top:    2.024"
  2094. .head 5 -  Width:  0.867"
  2095. .head 5 -  Width Editable? Yes
  2096. .head 5 -  Height: 0.167"
  2097. .head 5 -  Height Editable? Yes
  2098. .head 4 -  Visible? Yes
  2099. .head 4 -  Justify: Left
  2100. .head 4 -  Font Name: Default
  2101. .head 4 -  Font Size: Default
  2102. .head 4 -  Font Enhancement: Default
  2103. .head 4 -  Text Color: Default
  2104. .head 4 -  Background Color: Default
  2105. .head 3 +  Data Field: dfUser
  2106. .head 4 -  Class Child Ref Key: 0
  2107. .head 4 -  Class ChildKey: 0
  2108. .head 4 -  Class:
  2109. .head 4 -  Property Template:
  2110. .head 4 -  Class DLL Name:
  2111. .head 4 -  Data
  2112. .head 5 -  Maximum Data Length: Default
  2113. .head 5 -  Data Type: String
  2114. .head 5 -  Editable? Yes
  2115. .head 4 -  Display Settings
  2116. .head 5 -  Window Location and Size
  2117. .head 6 -  Left:   2.667"
  2118. .head 6 -  Top:    1.988"
  2119. .head 6 -  Width:  1.983"
  2120. .head 6 -  Width Editable? Yes
  2121. .head 6 -  Height: 0.25"
  2122. .head 6 -  Height Editable? Yes
  2123. .head 5 -  Visible? Yes
  2124. .head 5 -  Border? Yes
  2125. .head 5 -  Justify: Left
  2126. .head 5 -  Format: Unformatted
  2127. .head 5 -  Country: Default
  2128. .head 5 -  Font Name: Default
  2129. .head 5 -  Font Size: Default
  2130. .head 5 -  Font Enhancement: Default
  2131. .head 5 -  Text Color: Default
  2132. .head 5 -  Background Color: Default
  2133. .head 5 -  Input Mask: Unformatted
  2134. .head 4 -  Message Actions
  2135. .head 3 -  Background Text: &Password:
  2136. .head 4 -  Resource Id: 4313
  2137. .head 4 -  Class Child Ref Key: 0
  2138. .head 4 -  Class ChildKey: 0
  2139. .head 4 -  Class:
  2140. .head 4 -  Window Location and Size
  2141. .head 5 -  Left:   1.3"
  2142. .head 5 -  Top:    2.333"
  2143. .head 5 -  Width:  0.867"
  2144. .head 5 -  Width Editable? Yes
  2145. .head 5 -  Height: 0.167"
  2146. .head 5 -  Height Editable? Yes
  2147. .head 4 -  Visible? Yes
  2148. .head 4 -  Justify: Left
  2149. .head 4 -  Font Name: Default
  2150. .head 4 -  Font Size: Default
  2151. .head 4 -  Font Enhancement: Default
  2152. .head 4 -  Text Color: Default
  2153. .head 4 -  Background Color: Default
  2154. .head 3 +  Data Field: dfPassword
  2155. .head 4 -  Class Child Ref Key: 0
  2156. .head 4 -  Class ChildKey: 0
  2157. .head 4 -  Class:
  2158. .head 4 -  Property Template:
  2159. .head 4 -  Class DLL Name:
  2160. .head 4 -  Data
  2161. .head 5 -  Maximum Data Length: Default
  2162. .head 5 -  Data Type: String
  2163. .head 5 -  Editable? Yes
  2164. .head 4 -  Display Settings
  2165. .head 5 -  Window Location and Size
  2166. .head 6 -  Left:   2.667"
  2167. .head 6 -  Top:    2.298"
  2168. .head 6 -  Width:  1.983"
  2169. .head 6 -  Width Editable? Yes
  2170. .head 6 -  Height: 0.25"
  2171. .head 6 -  Height Editable? Yes
  2172. .head 5 -  Visible? Yes
  2173. .head 5 -  Border? Yes
  2174. .head 5 -  Justify: Left
  2175. .head 5 -  Format: Invisible
  2176. .head 5 -  Country: Default
  2177. .head 5 -  Font Name: Default
  2178. .head 5 -  Font Size: Default
  2179. .head 5 -  Font Enhancement: Default
  2180. .head 5 -  Text Color: Default
  2181. .head 5 -  Background Color: Default
  2182. .head 5 -  Input Mask: Unformatted
  2183. .head 4 -  Message Actions
  2184. .head 3 +  Pushbutton: pbLogin
  2185. .head 4 -  Class Child Ref Key: 0
  2186. .head 4 -  Class ChildKey: 0
  2187. .head 4 -  Class:
  2188. .head 4 -  Property Template:
  2189. .head 4 -  Class DLL Name:
  2190. .head 4 -  Title: &Login
  2191. .head 4 -  Window Location and Size
  2192. .head 5 -  Left:   1.85"
  2193. .head 5 -  Top:    2.631"
  2194. .head 5 -  Width:  1.2"
  2195. .head 5 -  Width Editable? Yes
  2196. .head 5 -  Height: 0.298"
  2197. .head 5 -  Height Editable? Yes
  2198. .head 4 -  Visible? Yes
  2199. .head 4 -  Keyboard Accelerator: Enter
  2200. .head 4 -  Font Name: Default
  2201. .head 4 -  Font Size: Default
  2202. .head 4 -  Font Enhancement: Default
  2203. .head 4 -  Picture File Name:
  2204. .head 4 -  Picture Transparent Color: None
  2205. .head 4 -  Image Style: Single
  2206. .head 4 -  Text Color: Default
  2207. .head 4 -  Background Color: Default
  2208. .head 4 +  Message Actions
  2209. .head 5 +  On SAM_Click
  2210. .head 6 -  Call SalSendMsg( hWndForm, SAM_Close, TRUE, 0 )
  2211. .head 3 +  Pushbutton: pbCancel
  2212. .head 4 -  Class Child Ref Key: 0
  2213. .head 4 -  Class ChildKey: 0
  2214. .head 4 -  Class:
  2215. .head 4 -  Property Template:
  2216. .head 4 -  Class DLL Name:
  2217. .head 4 -  Title: Cancel
  2218. .head 4 -  Window Location and Size
  2219. .head 5 -  Left:   3.183"
  2220. .head 5 -  Top:    2.631"
  2221. .head 5 -  Width:  1.2"
  2222. .head 5 -  Width Editable? Yes
  2223. .head 5 -  Height: 0.298"
  2224. .head 5 -  Height Editable? Yes
  2225. .head 4 -  Visible? Yes
  2226. .head 4 -  Keyboard Accelerator: Esc
  2227. .head 4 -  Font Name: Default
  2228. .head 4 -  Font Size: Default
  2229. .head 4 -  Font Enhancement: Default
  2230. .head 4 -  Picture File Name:
  2231. .head 4 -  Picture Transparent Color: None
  2232. .head 4 -  Image Style: Single
  2233. .head 4 -  Text Color: Default
  2234. .head 4 -  Background Color: Default
  2235. .head 4 +  Message Actions
  2236. .head 5 +  On SAM_Click
  2237. .head 6 -  Call SalSendMsg( hWndForm, SAM_Close, FALSE, 0 )
  2238. .head 2 -  Functions
  2239. .head 2 +  Window Parameters
  2240. .head 3 -  String: p_sDatabase
  2241. .head 3 -  String: p_sUser
  2242. .head 3 -  String: p_sPassword
  2243. .head 2 -  Window Variables
  2244. .head 2 +  Message Actions
  2245. .head 3 +  On SAM_Create
  2246. .head 4 -  Call SalCenterWindow( hWndForm )
  2247. .head 4 -  Set dfDatabase = p_sDatabase
  2248. .head 4 -  Set dfUser = p_sUser
  2249. .head 4 -  Set dfPassword = p_sPassword
  2250. .head 3 +  On SAM_Close
  2251. .head 4 +  If wParam
  2252. .head 5 -  Set p_sDatabase = dfDatabase
  2253. .head 5 -  Set p_sUser = dfUser
  2254. .head 5 -  Set p_sPassword = dfPassword
  2255. .head 4 -  Call SalEndDialog( hWndForm, wParam )
  2256.